5560 Hide community spotlight setting if not enabled
This commit is contained in:
parent
6502000429
commit
8b1f0453a1
3 changed files with 18 additions and 4 deletions
|
|
@ -7,5 +7,6 @@
|
|||
%br
|
||||
%br
|
||||
= t('.try_adding_some_more_contacts')
|
||||
!= t('.or_spotlight', :link => link_to(t(".community_spotlight") , community_spotlight_path))
|
||||
- if AppConfig.settings.community_spotlight.enable?
|
||||
!= t('.or_spotlight', :link => link_to(t(".community_spotlight") , community_spotlight_path))
|
||||
|
||||
|
|
|
|||
|
|
@ -85,9 +85,10 @@
|
|||
|
||||
= f.fields_for :stream_preferences do |type|
|
||||
#stream_prefs
|
||||
= f.label :show_community_spotlight_in_stream, :class => "checkbox" do
|
||||
= f.check_box :show_community_spotlight_in_stream
|
||||
= t('.show_community_spotlight')
|
||||
- if AppConfig.settings.community_spotlight.enable?
|
||||
= f.label :show_community_spotlight_in_stream, :class => "checkbox" do
|
||||
= f.check_box :show_community_spotlight_in_stream
|
||||
= t('.show_community_spotlight')
|
||||
|
||||
.small-horizontal-spacer
|
||||
= f.label :getting_started, :class => "checkbox" do
|
||||
|
|
|
|||
|
|
@ -215,6 +215,18 @@ describe UsersController, :type => :controller do
|
|||
expect(response.status).to eq(200)
|
||||
end
|
||||
|
||||
it 'displays community spotlight checkbox' do
|
||||
AppConfig.settings.community_spotlight.enable = true
|
||||
get 'edit', :id => @user.id
|
||||
expect(response.body).to include('input name="user[show_community_spotlight_in_stream]"')
|
||||
end
|
||||
|
||||
it 'hides community spotlight checkbox' do
|
||||
AppConfig.settings.community_spotlight = false
|
||||
get 'edit', :id => @user.id
|
||||
expect(response.body).not_to include('input name="user[show_community_spotlight_in_stream]"')
|
||||
end
|
||||
|
||||
it 'set @email_pref to false when there is a user pref' do
|
||||
@user.user_preferences.create(:email_type => 'mentioned')
|
||||
get 'edit', :id => @user.id
|
||||
|
|
|
|||
Loading…
Reference in a new issue