diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-08-06 12:16:36 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-08-06 12:16:36 +0200 |
commit | 4f24eb2aa670877faeef0f486af00d74e007ad01 (patch) | |
tree | 3b8c9ccbe779050db829565910e8652392af4dcf /spec/controllers/branches_controller_spec.rb | |
parent | c6799b0e1ecd1b7373f0ea23195e18c7ad5c199d (diff) | |
parent | fff36a8b8965e4bddd8020caf5072e79bf131a74 (diff) | |
download | gitlab-ce-merge-notifs.tar.gz |
Merge branch 'master' into merge-notifsmerge-notifs
Diffstat (limited to 'spec/controllers/branches_controller_spec.rb')
-rw-r--r-- | spec/controllers/branches_controller_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/controllers/branches_controller_spec.rb b/spec/controllers/branches_controller_spec.rb index bd4c946b64b..8e06d4bdc77 100644 --- a/spec/controllers/branches_controller_spec.rb +++ b/spec/controllers/branches_controller_spec.rb @@ -54,6 +54,13 @@ describe Projects::BranchesController do let(:ref) { "<script>alert('ref');</script>" } it { is_expected.to render_template('new') } end + + context "valid branch name with encoded slashes" do + let(:branch) { "feature%2Ftest" } + let(:ref) { "<script>alert('ref');</script>" } + it { is_expected.to render_template('new') } + it { project.repository.branch_names.include?('feature/test')} + end end describe "POST destroy" do @@ -74,6 +81,19 @@ describe Projects::BranchesController do it { expect(subject).to render_template('destroy') } end + context "valid branch name with unencoded slashes" do + let(:branch) { "improve/awesome" } + + it { expect(response.status).to eq(200) } + it { expect(subject).to render_template('destroy') } + end + + context "valid branch name with encoded slashes" do + let(:branch) { "improve%2Fawesome" } + + it { expect(response.status).to eq(200) } + it { expect(subject).to render_template('destroy') } + end context "invalid branch name, valid ref" do let(:branch) { "no-branch" } |