mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Stub site setting methods instead of setting them
This commit is contained in:
parent
2c8ed8414c
commit
41729aab14
1 changed files with 8 additions and 9 deletions
|
@ -6,27 +6,26 @@ describe SiteSetting do
|
|||
|
||||
describe 'call_discourse_hub?' do
|
||||
it 'should be true when enforce_global_nicknames is true and discourse_org_access_key is set' do
|
||||
SiteSetting.enforce_global_nicknames = true
|
||||
SiteSetting.enforce_global_nicknames.should == true
|
||||
SiteSetting.discourse_org_access_key = 'asdfasfsafd'
|
||||
SiteSetting.stubs(:enforce_global_nicknames).returns(true)
|
||||
SiteSetting.stubs(:discourse_org_access_key).returns('asdfasfsafd')
|
||||
SiteSetting.call_discourse_hub?.should == true
|
||||
end
|
||||
|
||||
it 'should be false when enforce_global_nicknames is false and discourse_org_access_key is set' do
|
||||
SiteSetting.enforce_global_nicknames = false
|
||||
SiteSetting.discourse_org_access_key = 'asdfasfsafd'
|
||||
SiteSetting.stubs(:enforce_global_nicknames).returns(false)
|
||||
SiteSetting.stubs(:discourse_org_access_key).returns('asdfasfsafd')
|
||||
SiteSetting.call_discourse_hub?.should == false
|
||||
end
|
||||
|
||||
it 'should be false when enforce_global_nicknames is true and discourse_org_access_key is not set' do
|
||||
SiteSetting.enforce_global_nicknames = true
|
||||
SiteSetting.discourse_org_access_key = ''
|
||||
SiteSetting.stubs(:enforce_global_nicknames).returns(true)
|
||||
SiteSetting.stubs(:discourse_org_access_key).returns('')
|
||||
SiteSetting.call_discourse_hub?.should == false
|
||||
end
|
||||
|
||||
it 'should be false when enforce_global_nicknames is false and discourse_org_access_key is not set' do
|
||||
SiteSetting.enforce_global_nicknames = false
|
||||
SiteSetting.discourse_org_access_key = ''
|
||||
SiteSetting.stubs(:enforce_global_nicknames).returns(false)
|
||||
SiteSetting.stubs(:discourse_org_access_key).returns('')
|
||||
SiteSetting.call_discourse_hub?.should == false
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue