adds spec for voting from debate index [#25]

This commit is contained in:
rgarcia
2015-08-05 12:13:49 +02:00
parent 5ce8db002b
commit c2e7ff32b1

View File

@@ -30,7 +30,7 @@ feature 'Votes' do
end
end
scenario 'Create', :js do
scenario 'Create from debate show', :js do
find('#in_favor a').click
within('#in_favor') do
@@ -44,6 +44,23 @@ feature 'Votes' do
expect(page).to have_content "1 vote"
end
scenario 'Create from debate index', :js do
visit debates_path
find('#in_favor a').click
within('#in_favor') do
expect(page).to have_content "100%"
end
within('#against') do
expect(page).to have_content "0%"
end
expect(page).to have_content "1 vote"
expect(URI.parse(current_url).path).to eq(debates_path)
end
scenario 'Update', :js do
find('#in_favor a').click
find('#against a').click