mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 18:39:52 +01:00
29 lines
637 B
Ruby
29 lines
637 B
Ruby
# 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
|