please help solve the problem. i use rails4 + rspec2 + pry + capybara.
my test:
describe 'albums?' do
it 'check albums page' do
user = FactoryGirl.create(:user)
visit user_albums_path(user.id)
expect(response.status).to eq(200)
expect(response).to render_template(:index)
binding.pry
expect(page).to have_selector('.albums_list_label')
end
end
i run in console:
rspec spec
and i output DOM response:
[1] pry(#<RSpec::ExampleGroups::PersonsController::Albums>)> puts
page.body
result:
.....
........
<h1>
<span class="albums_list_label" id="albumsListLabel">Список
альбомов</span>
<span class="name">:: us7</span>
</h1>
.........
............
but when i run:
continue
i get follow error message:
.F............
Failures:
1) AlbumsController index action check albums page
Failure/Error: expect(page).to have_selector(".albums_list_label")
expected to find css ".albums_list_label" but there were no
matches
problem: element with class .albums_list_label contains in server
response (DOM), but test is failed
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/bfef48ad18c059402af6281cd8251df3%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.