Skip to content

Commit fa5195d

Browse files
committed
AO3-7366_AO3-7367 add the test specs for page titles on Skins pages
1 parent 5ce3d2e commit fa5195d

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

spec/controllers/skins_controller_spec.rb

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,4 +622,34 @@
622622
end
623623
end
624624
end
625+
626+
describe "GET #index" do
627+
let(:user) { create(:user) }
628+
629+
context "when logged in as the user viewing their work skins" do
630+
before { fake_login_known_user(user) }
631+
632+
it "sets the page subtitle with the username for work skins" do
633+
get :index, params: { user_id: user.login, skin_type: "WorkSkin" }
634+
expect(assigns[:page_subtitle]).to eq("#{user.login} - Work Skins")
635+
end
636+
637+
it "sets the page subtitle with the username for site skins" do
638+
get :index, params: { user_id: user.login }
639+
expect(assigns[:page_subtitle]).to eq("#{user.login} - Site Skins")
640+
end
641+
end
642+
643+
context "when logged out" do
644+
it "sets the page subtitle for public work skins" do
645+
get :index, params: { skin_type: "WorkSkin" }
646+
expect(assigns[:page_subtitle]).to eq("Public Work Skins")
647+
end
648+
649+
it "sets the page subtitle for public site skins" do
650+
get :index
651+
expect(assigns[:page_subtitle]).to eq("Public Site Skins")
652+
end
653+
end
654+
end
625655
end

0 commit comments

Comments
 (0)