mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-15 01:13:43 +08:00
Merge pull request #843 from mlorb/ml-sci-1574
Add integration test for signup.feature [SCI-1574]
This commit is contained in:
commit
324ecf1bb4
4 changed files with 21 additions and 57 deletions
|
@ -23,12 +23,12 @@
|
||||||
<%= f.password_field :password, autocomplete: 'off', class: 'form-control' %>
|
<%= f.password_field :password, autocomplete: 'off', class: 'form-control' %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group" id="password_confirmation_form">
|
||||||
<%= f.label :password_confirmation %>
|
<%= f.label :password_confirmation %>
|
||||||
<%= f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control' %>
|
<%= f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control' %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group" id="team_name_form">
|
||||||
<%= label :team, :name, t('users.registrations.new.team_name_label') %>
|
<%= label :team, :name, t('users.registrations.new.team_name_label') %>
|
||||||
<% if @team %>
|
<% if @team %>
|
||||||
<%= text_field :team, :name, class: 'form-control', value: @team.name %>
|
<%= text_field :team, :name, class: 'form-control', value: @team.name %>
|
||||||
|
|
|
@ -27,3 +27,21 @@ Feature: Sign up
|
||||||
And I click "Sign up" button
|
And I click "Sign up" button
|
||||||
Then I should see "SpliceGirls"
|
Then I should see "SpliceGirls"
|
||||||
And I should be on homepage
|
And I should be on homepage
|
||||||
|
|
||||||
|
@javascript
|
||||||
|
Scenario: Unsuccessful sign up, password confirmation does not match
|
||||||
|
Given I visit the sign up page
|
||||||
|
Then I fill the sign up form with
|
||||||
|
| Full name | Email | Password | Password confirmation | Team name |
|
||||||
|
| Magnus | magnus@gmail.com | asdf1234 | asdf1234567 | SpliceGirls |
|
||||||
|
And I click "Sign up" button
|
||||||
|
Then I should see "doesn't match Password" error message under "password_confirmation_form" field
|
||||||
|
|
||||||
|
@javascript
|
||||||
|
Scenario: Unsuccessful sign up, team name is missing
|
||||||
|
Given I visit the sign up page
|
||||||
|
Then I fill the sign up form with
|
||||||
|
| Full name | Email | Password | Password confirmation |
|
||||||
|
| Magnus | magnus@gmail.com | asdf1234 | asdf1234 |
|
||||||
|
And I click "Sign up" button
|
||||||
|
Then I should see "is too short (minimum is 2 characters)" error message under "team_name_form" field
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
# feature/sign up.feature
|
|
||||||
Feature: Sign up
|
|
||||||
As a new User
|
|
||||||
I want to Sign up as a new User
|
|
||||||
I want to create a new account
|
|
||||||
|
|
||||||
Background:
|
|
||||||
Given the following users is registered:
|
|
||||||
| email | password | team
|
|
||||||
| nonadmin@myorg.com | mypassword1234 | BioSistemika Process
|
|
||||||
|
|
||||||
Scenario: Successful Sign up
|
|
||||||
Given I am on Sign up page
|
|
||||||
Then I fill the Sign up form with
|
|
||||||
| Full name | Email | Password | Password confirmation | Team name |
|
|
||||||
| Karli | nonuser@myorg.com | mypassword1234 | mypassword1234 | BioSistemika Process |
|
|
||||||
And I click on reCAPTCHA.
|
|
||||||
And I click on "Sign up" button
|
|
||||||
Then I should see "BioSistemika Process"
|
|
||||||
Then I should see "Hi, Karli" nex to the avatar
|
|
||||||
And I should get a Gamification pop up message "Welcome to sciNote."
|
|
||||||
|
|
||||||
Scenario: Unsuccessful Sign up, Password confirmation does not match
|
|
||||||
Given I am on Sign up page
|
|
||||||
Then I fill the Sign up form with
|
|
||||||
| Full name | Email | Password | Password confirmation | Team name |
|
|
||||||
| Karli | nonuser@myorg.com | mypassword1234 | mypassword123344 | BioSistemika Process |
|
|
||||||
And I click on reCAPTCHA.
|
|
||||||
And I click on "Sign up" button
|
|
||||||
Then I should see "doesn't match Password" error message under "Password confirmation" field
|
|
||||||
|
|
||||||
Scenario: Unsuccessful Sign up, Team name is missing
|
|
||||||
Given I am on Sign up page
|
|
||||||
Then I fill the Sign up form with
|
|
||||||
| Full name | Email | Password | Password confirmation |
|
|
||||||
| Karli | nonuser@myorg.com | mypassword1234 | mypassword123344 |
|
|
||||||
And I click on reCAPTCHA.
|
|
||||||
And I click on "Sign up" button
|
|
||||||
Then I should see "is too short (minimum is 2 characters)" error message under "Team name" field
|
|
||||||
|
|
||||||
Scenario: Unsuccessful Sign up, reCAPTCHA is missing
|
|
||||||
Given I am on Sign up page
|
|
||||||
Then I fill the Sign up form with
|
|
||||||
| Full name | Email | Password | Password confirmation | Team name |
|
|
||||||
| Karli | nonuser@myorg.com | mypassword1234 | mypassword1234 | BioSistemika Process |
|
|
||||||
And I click on "Sign up" button
|
|
||||||
Then I should see "reCAPTCHA verification failed, please try again." error message under "recaptcha" field
|
|
||||||
|
|
||||||
Scenario: Unsuccessful Sign up, Email has already been taken
|
|
||||||
Given I am on Sign up page
|
|
||||||
Then I fill the Sign up form with
|
|
||||||
| Full name | Email | Password | Password confirmation | Team name |
|
|
||||||
| Karli | nonadmin@myorg.com | mypassword1234 | mypassword1234 | BioSistemika Process |
|
|
||||||
And I click on "Sign up" button
|
|
||||||
Then I should see "has already been taken" error message under Email field
|
|
|
@ -1,6 +1,7 @@
|
||||||
Given(/^the following users are registered$/) do |table|
|
Given(/^the following users are registered$/) do |table|
|
||||||
table.hashes.each do |hash|
|
table.hashes.each do |hash|
|
||||||
FactoryGirl.create(:user, hash)
|
FactoryGirl.create(:user, hash)
|
||||||
|
User.find_by_email(hash.fetch('email')).confirm
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue