diff options
author | Rogelio Mita <rogeliomita@activitycentral.com> | 2013-09-05 17:53:20 (GMT) |
---|---|---|
committer | Rogelio Mita <rogeliomita@activitycentral.com> | 2013-09-05 17:53:20 (GMT) |
commit | 4839732e7379a68b5e298fe9aa88009c98d00f43 (patch) | |
tree | 84e558022e4a7ada5a77cfe75e4c5e6c12f8be6f | |
parent | 1f052544b0ad2a1d1eb07da13e05577ff2792d8b (diff) |
Add mising feature files
-rw-r--r-- | webapp/webapp/features/download_csv_button.py | 22 | ||||
-rw-r--r-- | webapp/webapp/features/download_csv_button_exists.feature | 11 |
2 files changed, 33 insertions, 0 deletions
diff --git a/webapp/webapp/features/download_csv_button.py b/webapp/webapp/features/download_csv_button.py new file mode 100644 index 0000000..8543f94 --- /dev/null +++ b/webapp/webapp/features/download_csv_button.py @@ -0,0 +1,22 @@ +from lettuce import step, world +from lettuce.django import django_url +from nose.tools import assert_true, assert_equals +from django.core.urlresolvers import reverse + + +@step(u'Then I should see a "([^"]*)" button') +def then_i_should_see_a_label_button(step, button_label): + browser = world.browser + button_names = {"Descargar resultados (csv)": "download_results_as_csv"} + button_name = button_names[button_label] + assert_true( + browser.is_element_present_by_name(button_name)) + world.button = browser.find_by_name(button_name)[0] + + +@step(u'And the button links to "([^"]*)" for "([^"]*)"') +def button_links_to_url_name_for_poll_name(step, url_name, poll_name): + poll_id = str(world.poll_id) + button = world.button + csv_download_url = reverse(url_name, kwargs={'poll_id': poll_id}) + assert_equals(django_url(csv_download_url), button['href']) diff --git a/webapp/webapp/features/download_csv_button_exists.feature b/webapp/webapp/features/download_csv_button_exists.feature new file mode 100644 index 0000000..50ddf76 --- /dev/null +++ b/webapp/webapp/features/download_csv_button_exists.feature @@ -0,0 +1,11 @@ +Feature: Button for download results as csv + As a reasearcher + I want see a csv button + So that I can download all results + + Scenario: Visit "Resultados" page with at least one .poll_result + Given I am a researcher + And "poll1" exists + When I visit the "Resultados" page for "poll1" poll + Then I should see a "Descargar resultados (csv)" button + And the button links to "sociologist:csv_download" for "poll1" |