summaryrefslogtreecommitdiff
path: root/spec/helpers/projects_helper_spec.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-05-04 17:05:16 -0400
committerRobert Speicher <rspeicher@gmail.com>2016-05-04 17:05:16 -0400
commitf18ec70743375024aa7ec7bb86c437ca9198e729 (patch)
tree4fe1fb68fbb9ced4ff5f5514f755916554d2d384 /spec/helpers/projects_helper_spec.rb
parentfad7b392dc633fb689e657af8b7fad346ede416e (diff)
downloadgitlab-ce-f18ec70743375024aa7ec7bb86c437ca9198e729.tar.gz
Backport changes from gitlab-org/gitlab-ee!372rs-backport-ee-372
Mostly replaces several Spinach tests with RSpec Feature tests.
Diffstat (limited to 'spec/helpers/projects_helper_spec.rb')
-rw-r--r--spec/helpers/projects_helper_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb
index 62389188d2c..6f7e2ae78fd 100644
--- a/spec/helpers/projects_helper_spec.rb
+++ b/spec/helpers/projects_helper_spec.rb
@@ -88,18 +88,18 @@ describe ProjectsHelper do
end
describe 'default_clone_protocol' do
- describe 'using HTTP' do
+ context 'when user is not logged in and gitlab protocol is HTTP' do
it 'returns HTTP' do
- expect(helper).to receive(:current_user).and_return(nil)
+ allow(helper).to receive(:current_user).and_return(nil)
expect(helper.send(:default_clone_protocol)).to eq('http')
end
end
- describe 'using HTTPS' do
+ context 'when user is not logged in and gitlab protocol is HTTPS' do
it 'returns HTTPS' do
- allow(Gitlab.config.gitlab).to receive(:protocol).and_return('https')
- expect(helper).to receive(:current_user).and_return(nil)
+ stub_config_setting(protocol: 'https')
+ allow(helper).to receive(:current_user).and_return(nil)
expect(helper.send(:default_clone_protocol)).to eq('https')
end