docbrown/spec/system/user_views_logo_spec.rb
Julianna Tetreault 8d00e27b69
Remove Creator Onboarding Feature Flags from Codebase (#15982)
* Removes FeatureFlag.enabled?(:creator_onboarding) from codebase

* Removes FeatureFlag.enabled?(:creator_onboarding) from specs

* Further cleanup, removal, and spec fixes

* Fixes the user_request_confirmation_spec.rb

* Reverts change to confirmation email button

* Revert revert after looking at designs again :(

* Removes redundant logo_png field from config + fixes test

* Rewords an expectation in user_uses_the_editor_spec.rb

* Revert removal of logo_png from Config images

* Removes CSS class from user_uses_the_editor_spec.rb

* Removes test from user_uses_the_editor_sepc.rb

* Removes unnecessary else from _logo.html.erb

* Adds back removed system spec

* Removes SVG-related code from _logo.html.erb

* Removes AsyncInfoController#use_creator_onboarding

* Fixes spec failues due to removed code

* Removes svg-related code (that I thought I removed already :/ )

* Re-removes FeatureFlag and logo_svg from _images.html.erb

* Remove newest instances of FeatureFlag(:creator_onboarding)

* remove instances where we use the creator_onboarding field from the base_data

* fix: redirect to the correct path in the reguistrations controller based on whether the user is a creator or not

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2022-01-31 11:30:43 -07:00

42 lines
1.1 KiB
Ruby

require "rails_helper"
RSpec.describe "Logo behaviour with creator_onboarding Feature Flag", type: :system do
let!(:user) { create(:user) }
let(:resized_logo) { "default.png" }
before do
sign_in user
end
context "when Feature flag creator_onboarding is enabled" do
before do
allow(FeatureFlag).to receive(:enabled?).with(:creator_onboarding).and_return(true)
end
context "with an image set" do
before do
allow(Settings::General).to receive(:resized_logo).and_return(resized_logo)
end
it "renders the resized_logo" do
visit root_path
within(".site-logo") do
expect(page.find(".site-logo__img")["src"]).to have_content(resized_logo)
end
end
end
context "without an image set" do
before do
allow(Settings::General).to receive(:resized_logo).and_return(nil)
end
it "renders the the community name" do
visit root_path
within(".truncate-at-2") do
expect(page).to have_text("DEV(local)")
end
end
end
end
end