Skip to content

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
klaustopher committed Jul 9, 2024
1 parent 5fc970d commit 4e40a49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/controllers/projects/queries_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
end

it "calls publish service on query" do
post "toggle_public", params: { id: 42 }
post "toggle_public", params: { id: 42, value: 1 }

expect(service_instance).to have_received(:call).with(query_params)
end
Expand All @@ -301,7 +301,7 @@
it "redirects to projects" do
allow(I18n).to receive(:t).with("lists.publish.success").and_return("foo")

post "toggle_public", params: { id: 42 }
post "toggle_public", params: { id: 42, value: 1 }

expect(flash[:notice]).to eq("foo")
expect(response).to redirect_to(projects_path(query_id: query.id))
Expand All @@ -319,7 +319,7 @@
it "renders projects/index" do
allow(I18n).to receive(:t).with("lists.publish.failure", errors: "something\nwent\nwrong").and_return("bar")

post "toggle_public", params: { id: 42 }
post "toggle_public", params: { id: 42, value: 1 }

expect(flash[:error]).to eq("bar")
expect(response).to render_template("projects/index")
Expand All @@ -328,7 +328,7 @@
it "passes variables to template" do
allow(controller).to receive(:render).and_call_original

post "toggle_public", params: { id: 42 }
post "toggle_public", params: { id: 42, value: 1 }

expect(controller).to have_received(:render).with(include(locals: { query:, state: :edit }))
end
Expand Down

0 comments on commit 4e40a49

Please sign in to comment.