summaryrefslogtreecommitdiff
path: root/spec/helpers/preferences_helper_spec.rb
diff options
context:
space:
mode:
authortiagonbotelho <tiagonbotelho@hotmail.com>2016-11-15 14:21:05 +0000
committertiagonbotelho <tiagonbotelho@hotmail.com>2016-11-15 14:21:05 +0000
commitc9d93f645aed1fbb9196616afb0110a585882fc1 (patch)
treefb61391620b8249645a1a397074a40e917704ea6 /spec/helpers/preferences_helper_spec.rb
parent062c9a08c44f2e178476cace0ebd8a55aa27e866 (diff)
downloadgitlab-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.rb9
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