diff options
author | tiagonbotelho <tiagonbotelho@hotmail.com> | 2016-11-15 14:21:05 +0000 |
---|---|---|
committer | tiagonbotelho <tiagonbotelho@hotmail.com> | 2016-11-15 14:21:05 +0000 |
commit | c9d93f645aed1fbb9196616afb0110a585882fc1 (patch) | |
tree | fb61391620b8249645a1a397074a40e917704ea6 /spec/helpers/preferences_helper_spec.rb | |
parent | 062c9a08c44f2e178476cace0ebd8a55aa27e866 (diff) | |
download | gitlab-ce-c9d93f645aed1fbb9196616afb0110a585882fc1.tar.gz |
moves empty view logic onto empty partial to make it reusable and fixes tests
Diffstat (limited to 'spec/helpers/preferences_helper_spec.rb')
-rw-r--r-- | spec/helpers/preferences_helper_spec.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/helpers/preferences_helper_spec.rb b/spec/helpers/preferences_helper_spec.rb index 2bd4eace89f..02b464f7e07 100644 --- a/spec/helpers/preferences_helper_spec.rb +++ b/spec/helpers/preferences_helper_spec.rb @@ -87,17 +87,18 @@ describe PreferencesHelper do end describe 'default_project_view' do - let(:project) { create(:project) } - context 'user not signed in' do - before { stub_user } + before do + @project = create(:project) + stub_user + 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(project).to receive(:empty_repo?).and_return(true) + expect(@project).to receive(:empty_repo?).and_return(true) expect(helper.default_project_view).to eq('empty') end |