Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/webapp/webapp/features/upload_poll_result.feature
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/webapp/features/upload_poll_result.feature')
-rw-r--r--webapp/webapp/features/upload_poll_result.feature68
1 files changed, 63 insertions, 5 deletions
diff --git a/webapp/webapp/features/upload_poll_result.feature b/webapp/webapp/features/upload_poll_result.feature
index fa01a95..5ce7367 100644
--- a/webapp/webapp/features/upload_poll_result.feature
+++ b/webapp/webapp/features/upload_poll_result.feature
@@ -4,11 +4,69 @@ Feature: Upload .poll_result files
So that researcher can compute them like a chunk of the whole poll result
Scenario: Upload one valid .poll_result file
- Given I am a pollster: "encuestador1"
- And "poll1" is "Cerrada"
- And "encuestador1" is binded to "poll1"
- And "valid.poll_result" is authored by "encuestador1"
+ Given I am logged in as "Pollster"
+ And "closed_poll" exists
+ And "encuestador" is binded to "closed_poll"
+ And "valid.poll_result" is authored by "encuestador"
When I visit the "upload" page
- And I upload "valid.poll_result" on "31/12/1999 23:59hs"
+ And I upload "valid.poll_result"
Then I should see a message that says "valid.poll_result" and "éxito"
And "valid.poll_result" has the time string "31/12/1999 23:59hs"
+
+ Scenario: Invalid .poll_result file
+ Given I am logged in as "Pollster"
+ When I visit the "upload" page
+ And I upload "invalid.poll_result"
+ Then I should see a message that says "invalid.poll_result"
+ And I should see a message that says "No es un .poll_result válido."
+
+ Scenario: Upload .poll_result file that exists already
+ Given I am logged in as "Pollster"
+ And "closed_poll" exists
+ And "encuestador" is binded to "closed_poll"
+ And "valid.poll_result" is authored by "encuestador"
+ When I visit the "upload" page
+ And I upload "valid.poll_result"
+ When I visit the "upload" page
+ And I upload "valid.poll_result"
+ Then I should see a message that says "valid.poll_result"
+ And I should see a message that says "ya se encuentran publicados"
+
+ Scenario: Upload .poll_result file which its content had been uploaded
+ Given I am logged in as "Pollster"
+ And "closed_poll" exists
+ And "encuestador" is binded to "closed_poll"
+ And "valid.poll_result" is authored by "encuestador"
+ When I visit the "upload" page
+ And I upload "valid.poll_result"
+ And "valid_copy.poll_result" is authored by "encuestador"
+ When I visit the "upload" page
+ And I upload "valid_copy.poll_result"
+ Then I should see a message that says "valid_copy.poll_result"
+ And I should see a message that says "ya se encuentran publicados"
+
+ Scenario: Upload .poll_result wich its not authored by logged in pollster
+ Given I am logged in as "Pollster"
+ And "closed_poll" exists
+ When I visit the "upload" page
+ And I upload "other_owner.poll_result"
+ Then I should see a message that says "no pertencen a una encuesta realizada por usted"
+
+ Scenario: Upload .poll_result with a poll not assigned to logged in pollster
+ Given I am logged in as "Pollster"
+ And "poll" exists
+ When I visit the "upload" page
+ And I upload "not_asigned_poll.poll_result"
+ Then I should see a message that says "Estos son resultados de una encuesta que no le fué asignada."
+
+ Scenario: Upload two .poll_result with the same content at the same time
+ Given I am logged in as "Pollster"
+ And "poll" exists
+ When I visit the "upload" page
+ And I load "same_time.poll_result" on position "1"
+ And I load "same_time_copy.poll_result" on position "2"
+ When I upload loaded files
+ Then I should see a message that says "same_time.poll_result"
+ And I should see a message that says "éxito"
+ And I should see a message that says "same_time_copy.poll_result"
+ And I should see a message that says "ya se encuentran publicados"