diff options
Diffstat (limited to 'spec/helpers/blob_helper_spec.rb')
-rw-r--r-- | spec/helpers/blob_helper_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/helpers/blob_helper_spec.rb b/spec/helpers/blob_helper_spec.rb index b584a906565..885569574a4 100644 --- a/spec/helpers/blob_helper_spec.rb +++ b/spec/helpers/blob_helper_spec.rb @@ -304,6 +304,7 @@ RSpec.describe BlobHelper do let_it_be(:namespace) { create(:namespace, name: 'gitlab') } let_it_be(:project) { create(:project, :repository, namespace: namespace) } let_it_be(:current_user) { create(:user) } + let(:can_push_code) { true } let(:blob) { project.repository.blob_at('refs/heads/master', 'README.md') } @@ -489,9 +490,18 @@ RSpec.describe BlobHelper do expect(uri.path).to eq("/#{project.namespace.path}/#{project.path}/-/forks") expect(params).to include("continue[to]=/-/ide/project/#{project.namespace.path}/#{project.path}/edit/master") + expect(params).to include("continue[notice]=#{edit_in_new_fork_notice}") + expect(params).to include("continue[notice_now]=#{edit_in_new_fork_notice_now}") expect(params).to include("namespace_key=#{current_user.namespace.id}") end + it 'does not include notice params with_notice: false' do + uri = URI(helper.ide_fork_and_edit_path(project, "master", "", with_notice: false)) + + expect(uri.path).to eq("/#{project.namespace.path}/#{project.path}/-/forks") + expect(CGI.unescape(uri.query)).to eq("continue[to]=/-/ide/project/#{project.namespace.path}/#{project.path}/edit/master&namespace_key=#{current_user.namespace.id}") + end + context 'when user is not logged in' do let(:current_user) { nil } |