Skip to content

Commit

Permalink
Fix after signup page.
Browse files Browse the repository at this point in the history
  • Loading branch information
lennerd committed Aug 29, 2016
1 parent 7f4fef1 commit 7381982
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 48 deletions.
1 change: 0 additions & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def after_signup_update
end
redirect_to after_sign_in_path_for(:user)
else
flash.now[:alert] = @user.errors.full_messages.to_sentence
render :template => 'users/after_signup_edit'
end
end
Expand Down
8 changes: 4 additions & 4 deletions app/views/users/after_signup_edit.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.content.user-after-signup
= semantic_form_for @user, :url => after_signup_update_profile_path, :method => :put, :html => {:novalidate => '' } do |form|
= semantic_form_for @user, :url => after_signup_update_profile_path, :method => :put, :html => { :novalidate => '' } do |form|
.row-fluid.mt10
.span10.offset1
%h3=t('.welcome.headline')
Expand All @@ -9,12 +9,12 @@
.row-fluid.mt30
.span6.offset1
= form.inputs do
= form.input :email, hint: true, required: true
= form.input :first_time, :as => :hidden, :input_html => { :value => @user.encrypted_password.blank? ? '1' : '0' }
= form.input :email
= form.input :first_time, as: :hidden, input_html: { value: @user.encrypted_password.blank? ? '1' : '0' }

= form.actions class:'form-actions' do
= link_to t('common.skip'), after_sign_in_path_for(:user), class: 'pull-left btn'
%input.small.update.btn#user_submit{:name => 'commit', :type => 'submit', :value => t('formtastic.labels.finish'), :style => 'display:inline', class: 'pull-right btn-primary', :'data-confirm' => t('devise.confirmations.send_instructions')}
%input.small.update.btn#user_submit{:name => 'commit', :type => 'submit', :value => t('formtastic.labels.finish'), :style => 'display:inline', class: 'pull-right btn-primary'}

- content_for :javascript do
= javascript_include_tag :search
2 changes: 0 additions & 2 deletions config/locales/de/rails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ de:
models:
user:
attributes:
email:
blank: "muss ausgefüllt werden, wenn ein Passwort gesetzt wird"
privacy_policy:
accepted: "müssen akzeptiert werden"
terms:
Expand Down
2 changes: 0 additions & 2 deletions config/locales/en/rails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ en:
models:
user:
attributes:
email:
blank: "can't be blank if password is given"
privacy_policy:
accepted: "must be accepted"
terms:
Expand Down
43 changes: 4 additions & 39 deletions spec/features/user_after_signup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,6 @@
visit after_signup_edit_profile_path
end

context "when first_name, email & password are given " do
given!(:user) { FactoryGirl.create(:user,
first_name: 'horst',
email: '[email protected]',
password: 'password',
password_confirmation: 'password',
confirmed_at: '10.10.1999',
osm_id: 174
)}

# additional test
scenario "I want to finalize my signup and click on button without changing the email" do
within("#user_email_input") do
fill_in "user_email", with: ""
end
click_button 'Fertigstellen'
pending("Bug: 'Du bekommst in wenigen Minuten eine E-Mail mit einem Link' instead of 'Email muss ausgefüllt werden'")
fail
expect { raise StandardError, 'Email muss ausgefüllt werden' }.to raise_error('Email muss ausgefüllt werden')
end
end

context "when first_name & email are given" do
given!(:user) { FactoryGirl.create(:user,
first_name: 'horst2',
Expand All @@ -47,14 +25,13 @@
osm_id: 174
)}

# Scenario: I set my password after signup
scenario "I set my password" do
# additional test
scenario "I want to finalize my signup and click on button without changing the email" do
within("#user_email_input") do
fill_in "user_email", with: ""
fill_in "user_email", with: ""
end
click_button 'Fertigstellen'
skip("Bug: No password setting possible on after signup edit page. Needs correction!")
fail
expect(page.current_path).to eq(root_path)
end

# Scenario: I set my email after signup with existing password
Expand Down Expand Up @@ -90,16 +67,4 @@
end
end
end

describe "is not logged in" do
scenario "I set my email after signup without any prior password" do
pending("BUG: This test case needs a revision since '/users/password/new' is not used anymore")
expect(current_path).to eq(new_user_password_path)
# When I am on the new user password page
# When I fill in "E-Mail" with "[email protected]"
# And I press "Passwort neu setzen"
# And PENDING: make cached flash testable
# And I should see "Du bekommst in wenigen Minuten eine E-Mail mit Informationen wie du dein Passwort neu setzen kannst."
end
end
end

0 comments on commit 7381982

Please sign in to comment.