Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint: fix spec tests missed in earlier lint run #31

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions spec/requests/emergency_banner_spec.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
RSpec.describe "Emergency Banners" do
context "getting a path with the banner partial" do
before do
Rails.application.config.emergency_banner_redis_client = redis_client
end

context "when getting a path with the banner partial" do
context "with the emergency banner active" do
before do
allow_any_instance_of(Redis).to receive(:hgetall).with("emergency_banner").and_return(
heading: "Emergency!",
campaign_class: "notable-death",
)
end
let(:redis_client) { instance_double(Redis, hgetall: { heading: "Emergency!", campaign_class: "notable-death" }) }

it "shows a banner in the page" do
get "/emergency"
Expand All @@ -24,9 +23,7 @@
end

context "with the emergency banner inactive" do
before do
allow_any_instance_of(Redis).to receive(:hgetall).with("emergency_banner").and_return({})
end
let(:redis_client) { instance_double(Redis, hgetall: {}) }

it "does not show a banner in the page" do
get "/emergency"
Expand Down
Loading