includes a "cancel" option when logging in via omniauth
restores missing proposal in common_actions
This commit is contained in:
@@ -82,9 +82,7 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def ensure_signup_complete
|
def ensure_signup_complete
|
||||||
if user_signed_in? &&
|
if user_signed_in? && !devise_controller? && current_user.registering_with_oauth
|
||||||
current_user.registering_with_oauth &&
|
|
||||||
%w(finish_signup do_finish_signup).exclude?(action_name)
|
|
||||||
redirect_to finish_signup_path
|
redirect_to finish_signup_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -16,4 +16,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= f.submit t("devise_views.users.registrations.new.submit"), class: 'button radius expand' %>
|
<%= f.submit t("devise_views.users.registrations.new.submit"), class: 'button radius expand' %>
|
||||||
|
<div class="text-center">
|
||||||
|
<%= link_to t("devise_views.users.registrations.new.cancel"), destroy_user_session_path, class: 'delete', method: :delete %>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ en:
|
|||||||
update_submit: Update
|
update_submit: Update
|
||||||
waiting_for: 'Awaiting confirmation of:'
|
waiting_for: 'Awaiting confirmation of:'
|
||||||
new:
|
new:
|
||||||
|
cancel: Cancel login
|
||||||
email_label: Email
|
email_label: Email
|
||||||
organization_signup: Do you represent an organisation or collective? %{signup_link}
|
organization_signup: Do you represent an organisation or collective? %{signup_link}
|
||||||
organization_signup_link: Sign up here
|
organization_signup_link: Sign up here
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ es:
|
|||||||
update_submit: Actualizar
|
update_submit: Actualizar
|
||||||
waiting_for: 'Esperando confirmación de:'
|
waiting_for: 'Esperando confirmación de:'
|
||||||
new:
|
new:
|
||||||
|
cancel: Cancelar login
|
||||||
email_label: Email
|
email_label: Email
|
||||||
organization_signup: "¿Representas a una organización / colectivo? %{signup_link}"
|
organization_signup: "¿Representas a una organización / colectivo? %{signup_link}"
|
||||||
organization_signup_link: Regístrate aquí
|
organization_signup_link: Regístrate aquí
|
||||||
|
|||||||
@@ -125,6 +125,21 @@ feature 'Users' do
|
|||||||
expect(page).to have_field('user_email', with: 'manueladelascarmenas@example.com')
|
expect(page).to have_field('user_email', with: 'manueladelascarmenas@example.com')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario 'Cancelling signup' do
|
||||||
|
OmniAuth.config.add_mock(:twitter, twitter_hash)
|
||||||
|
|
||||||
|
visit '/'
|
||||||
|
click_link 'Register'
|
||||||
|
click_link 'Sign up with Twitter'
|
||||||
|
|
||||||
|
expect(current_path).to eq(finish_signup_path)
|
||||||
|
click_link 'Cancel login'
|
||||||
|
|
||||||
|
|
||||||
|
visit '/'
|
||||||
|
expect_to_not_be_signed_in
|
||||||
|
end
|
||||||
|
|
||||||
scenario 'Sign in, user was already signed up with OAuth' do
|
scenario 'Sign in, user was already signed up with OAuth' do
|
||||||
user = create(:user, email: 'manuela@madrid.es', password: 'judgementday')
|
user = create(:user, email: 'manuela@madrid.es', password: 'judgementday')
|
||||||
create(:identity, uid: '12345', provider: 'twitter', user: user)
|
create(:identity, uid: '12345', provider: 'twitter', user: user)
|
||||||
|
|||||||
@@ -116,6 +116,10 @@ module CommonActions
|
|||||||
expect(find('.top-bar')).to have_content 'My account'
|
expect(find('.top-bar')).to have_content 'My account'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def expect_to_not_be_signed_in
|
||||||
|
expect(find('.top-bar')).to_not have_content 'My account'
|
||||||
|
end
|
||||||
|
|
||||||
def select_date(values, selector)
|
def select_date(values, selector)
|
||||||
selector = selector[:from]
|
selector = selector[:from]
|
||||||
day, month, year = values.split("-")
|
day, month, year = values.split("-")
|
||||||
|
|||||||
Reference in New Issue
Block a user