adds a helper for avatars in specs
This commit is contained in:
@@ -16,7 +16,7 @@ feature 'Account' do
|
||||
|
||||
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)
|
||||
expect(page).to have_selector(avatar('Manuela Colau'), count: 1)
|
||||
end
|
||||
|
||||
scenario "Failed Edit" do
|
||||
|
||||
@@ -17,7 +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)
|
||||
expect(page).to have_selector(avatar(comment.user.name), count: 1)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -25,7 +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)
|
||||
expect(page).to have_selector(avatar(debate.author.name), count: 1)
|
||||
|
||||
within('.social-share-button') do
|
||||
expect(page.all('a').count).to be(3) # Twitter, Facebook, Google+
|
||||
|
||||
@@ -56,4 +56,8 @@ module CommonActions
|
||||
SimpleCaptcha::SimpleCaptchaData.first.value
|
||||
end
|
||||
|
||||
def avatar(name)
|
||||
"img.initialjs-avatar[data-name='#{name}']"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user