Skip to content

Commit

Permalink
Add config_spec
Browse files Browse the repository at this point in the history
  • Loading branch information
sue445 committed Dec 25, 2023
1 parent a6b28de commit 1afa108
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/config_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
RSpec.describe "docs/config/" do
%w(connpass doorkeeper).each do |site|
describe "#{site}.json" do
subject(:groups) { JSON.parse(json_path.read)["groups"] }

let(:json_path) { config_dir.join("#{site}.json") }

it "id shouldn't be duplicated" do
ids = groups.map { |g| g["id"] }
expect(ids).to match_array(ids.uniq)
end

it "name shouldn't be duplicated" do
names = groups.map { |g| g["name"] }
expect(names).to match_array(names.uniq)
end
end
end
end
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,7 @@ def app
def spec_dir
Pathname(__dir__)
end

def config_dir
spec_dir.join("..", "docs", "config")
end

0 comments on commit 1afa108

Please sign in to comment.