Skip to content

Commit

Permalink
restore fancy profile to non-alice profile where it belongs
Browse files Browse the repository at this point in the history
  • Loading branch information
sneakers-the-rat committed Sep 15, 2024
1 parent a6e07a0 commit 323748b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
19 changes: 14 additions & 5 deletions spec/support/stories/profile_stories.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module ProfileStories
attr_reader :bob, :alice, :alice_bio, :alice_css
attr_reader :bob, :alice, :alice_bio, :chupacabra, :chupacabra_css

def fill_in_auth_details(email, password)
fill_in 'user_email', with: email
Expand Down Expand Up @@ -35,16 +35,25 @@ def with_alice_as_local_user
@alice_bio = '@alice and @bob are fictional characters commonly used as' \
'placeholder names in #cryptology, as well as #science and' \
'engineering 📖 literature. Not affiliated with @pepe.'
@alice_css = <<~CSS

@alice = Fabricate(
:user,
email: '[email protected]', password: password, confirmed_at: confirmed_at,
account: Fabricate(:account, username: 'alice', note: @alice_bio)
)
end

def with_chupacabras_fancy_profile
@chupacabra_css = <<~CSS
body {
background-color: red !important;
}
CSS

@alice = Fabricate(
@chupacabra = Fabricate(
:user,
email: 'alice@example.com', password: password, confirmed_at: confirmed_at,
account: Fabricate(:account, username: 'alice', note: @alice_bio, account_css: @alice_css)
email: 'chupacabra@example.com', password: password, confirmed_at: confirmed_at,
account: Fabricate(:account, username: 'chupacabra', note: 'I am gonna getcha!', account_css: @chupacabra_css)
)
end

Expand Down
5 changes: 2 additions & 3 deletions spec/system/profile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@

describe 'with JS', :js do
before do
as_a_logged_in_user
with_alice_as_local_user
with_chupacabras_fancy_profile
end

it 'Can have custom account_css set' do
visit account_path('alice')
visit account_path('chupacabra')
expect(subject.html).to have_content('background-color: red !important')
expect(subject).to have_xpath('//*[@id="account-css"]')

Expand Down

0 comments on commit 323748b

Please sign in to comment.