diff --git a/spec/features/account_spec.rb b/spec/features/account_spec.rb index 59ee23f5b..a50d26f7c 100644 --- a/spec/features/account_spec.rb +++ b/spec/features/account_spec.rb @@ -4,20 +4,22 @@ feature 'Account' do background do @user = create(:user, first_name: "Manuela", last_name:"Colau") + login_as(@user) end scenario 'Show' do - login_as(@user) visit root_path + click_link "My account" + expect(current_path).to eq(account_path) expect(page).to have_selector("input[value='Manuela']") expect(page).to have_selector("input[value='Colau']") + expect(page).to have_selector("img.initialjs-avatar[data-name='Manuela Colau'][data-height='100']", count: 1) end scenario "Failed Edit" do - login_as(@user) visit account_path fill_in 'account_first_name', with: '' @@ -31,7 +33,6 @@ feature 'Account' do end scenario 'Edit' do - login_as(@user) visit account_path fill_in 'account_first_name', with: 'Larry' diff --git a/spec/features/comments_spec.rb b/spec/features/comments_spec.rb index 77444cf61..3fa2464fb 100644 --- a/spec/features/comments_spec.rb +++ b/spec/features/comments_spec.rb @@ -17,6 +17,7 @@ feature 'Comments' do expect(page).to have_content comment.user.name expect(page).to have_content time_ago_in_words(comment.created_at) expect(page).to have_content comment.body + expect(page).to have_selector("img.initialjs-avatar[data-name='#{comment.user.name}'][data-height='32']", count: 1) end end diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index de3e05943..4a9f8c8f3 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -25,6 +25,7 @@ feature 'Debates' do expect(page).to have_content "Debate description" expect(page).to have_content debate.author.name expect(page).to have_content I18n.l(Date.today) + expect(page).to have_selector("img.initialjs-avatar[data-name='#{debate.author.name}'][data-height='32']", count: 1) within('.social-share-button') do expect(page.all('a').count).to be(3) # Twitter, Facebook, Google+