Skip to content

Commit

Permalink
Test expectations against specific items
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmaroli committed Dec 20, 2024
1 parent 2823895 commit 4636ecc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spec/jekyll-admin/server/data_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def app
it "gets the index" do
get "/data"
expect(last_response).to be_ok
expect(last_response_parsed[2]).to eql(base_response)
expect(last_response_parsed.find { |file| file["slug"] == "data_file" }).to eql(base_response)
end

it "gets an individual data file" do
Expand Down
8 changes: 6 additions & 2 deletions spec/jekyll-admin/server/theme_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ def app
get "/theme/_layouts"
expect(last_response).to be_ok
expect(last_response_parsed["name"]).to eq("_layouts")
expect(last_response_parsed["entries"].first).to eq(expected)
expect(
last_response_parsed["entries"].find { |layout| layout["name"] == "default.html" }
).to eq(expected)
end

it "returns subdirectories" do
Expand All @@ -69,7 +71,9 @@ def app
}
get "/theme/assets/images"
expect(last_response).to be_ok
expect(last_response_parsed["entries"].first).to eq(expected)
expect(
last_response_parsed["entries"].find { |img| img["name"] == "icon-dark.png" }
).to eq(expected)
end
end

Expand Down

0 comments on commit 4636ecc

Please sign in to comment.