Retrospring/spec/controllers/modal_controller_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
637 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require "rails_helper"
describe ModalController, type: :controller do
describe "#close" do
context "a regular web navigation request" do
subject { get :close }
it "should redirect to the root page" do
subject
expect(response).to redirect_to root_path
end
end
context "a Turbo Frame request" do
subject { get :close }
it "renders the show_reaction template" do
@request.headers["Turbo-Frame"] = "some_id"
subject
expect(response.body).to include('<turbo-frame id="modal"></turbo-frame>')
end
end
end
end