diff options
author | tiagonbotelho <tiagonbotelho@hotmail.com> | 2016-11-08 20:43:19 +0300 |
---|---|---|
committer | tiagonbotelho <tiagonbotelho@hotmail.com> | 2016-11-12 01:17:56 +0300 |
commit | 0527ea09920d49bb9e1574e7a61958ba70dbe24e (patch) | |
tree | 89b8d48e4f03ffee34de6cef11009ce3960ebbda /spec/helpers | |
parent | 6eeff67c6e03233d4480a55d05d4e0f1a88aef4c (diff) |
adds guard clause for readme model method and initializes a new view with proper stylesheets
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/preferences_helper_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/helpers/preferences_helper_spec.rb b/spec/helpers/preferences_helper_spec.rb index 2f9291afc3f..3830fe26158 100644 --- a/spec/helpers/preferences_helper_spec.rb +++ b/spec/helpers/preferences_helper_spec.rb @@ -85,4 +85,25 @@ describe PreferencesHelper do and_return(double('user', messages)) end end + + describe 'default_project_view' do + let(:project) { create(:project) } + + context 'user not signed in' do + before do + stub_user + @repository = project.repository + end + + it 'returns readme view if repository is not empty' do + expect(helper.default_project_view).to eq('readme') + end + + it 'returns activity if repository is empty' do + expect(@repository).to receive(:head_commit).and_return(nil) + + expect(helper.default_project_view).to eq('activity') + end + end + end end |