testing avatar presence

This commit is contained in:
David Gil
2015-08-12 20:08:01 +02:00
parent 2b16716ee1
commit c6154fe48d
3 changed files with 6 additions and 3 deletions

View File

@@ -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'

View File

@@ -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

View File

@@ -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+