Skip to content

Commit

Permalink
fix error in standalone navigation for sign in (#949)
Browse files Browse the repository at this point in the history
  • Loading branch information
timdiggins committed Jun 3, 2022
1 parent 30bbc0a commit e0a1c8c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/views/thredded/shared/nav/_standalone.html.erb
Expand Up @@ -2,11 +2,11 @@
<% resource_name = Thredded.user_class_name.demodulize.underscore %>
<% if thredded_signed_in? %>
<%= link_to main_app.send(:"destroy_#{resource_name}_session_path"), method: :delete do %>
t('thredded.nav.sign_out')
<%= t('thredded.nav.sign_out') %>
<% end %>
<% else %>
<%= link_to main_app.send(:"new_#{resource_name}_session_path") do %>
t('thredded.nav.sign_in')
<%= t('thredded.nav.sign_in') %>
<% end %>
<% end %>
</li>
2 changes: 1 addition & 1 deletion i18n-tasks.gemfile
@@ -1,3 +1,3 @@
# frozen_string_literal: true

gem 'i18n-tasks', '>= 0.9.29'
gem 'i18n-tasks', '>= 1.0.5'
15 changes: 15 additions & 0 deletions spec/system/thredded/visitor_signs_in_spec.rb
Expand Up @@ -18,4 +18,19 @@
user.fill_in_sign_in_form_and_submit
expect(topic).to have_followed_notice
end

context 'using the standalone layout' do
around do |example|
Thredded.layout = 'thredded/application'
example.run
Thredded.layout = 'application'
end

it 'via the sign in link and form' do
visit '/thredded'
click_on 'Sign In / Register'
user.fill_in_sign_in_form_and_submit
expect(page).to have_content('Sign Out')
end
end
end

0 comments on commit e0a1c8c

Please sign in to comment.