summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/branches_controller_spec.rb
diff options
context:
space:
mode:
authorJacopo <beschi.jacopo@gmail.com>2016-12-22 07:21:40 +0100
committerJacopo <beschi.jacopo@gmail.com>2017-03-13 16:36:11 +0100
commite0fe2834ebe6d9678444c8a10b79ca093f944232 (patch)
treea2d7c482f7271d8af7ba47e76c9d48a1d3e357f4 /spec/controllers/projects/branches_controller_spec.rb
parent9ed3db915026c6e0cd266a1c276386e3e96d2151 (diff)
downloadgitlab-ce-e0fe2834ebe6d9678444c8a10b79ca093f944232.tar.gz
New file from interface on existing branch
Now you can create a new file and select a target_branch != source_branch. If the file that you want to create already exists on the target branch an error message is shown A glDropdown is used to select and create a new branch instead of a text field.
Diffstat (limited to 'spec/controllers/projects/branches_controller_spec.rb')
-rw-r--r--spec/controllers/projects/branches_controller_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/controllers/projects/branches_controller_spec.rb b/spec/controllers/projects/branches_controller_spec.rb
index 298a7ff179c..d20e7368086 100644
--- a/spec/controllers/projects/branches_controller_spec.rb
+++ b/spec/controllers/projects/branches_controller_spec.rb
@@ -266,5 +266,19 @@ describe Projects::BranchesController do
expect(parsed_response.first).to eq 'master'
end
end
+
+ context 'show_all = true' do
+ it 'returns all the branches name' do
+ get :index,
+ namespace_id: project.namespace,
+ project_id: project,
+ format: :json,
+ show_all: true
+
+ parsed_response = JSON.parse(response.body)
+
+ expect(parsed_response.length).to eq(project.repository.branches.count)
+ end
+ end
end
end