summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/commit_controller_spec.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-10-12 21:37:04 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-10-12 21:37:04 +0200
commit2f2ad9eaf06e4573da77f9602fa9678711dba4d9 (patch)
tree0f0eb102b146da8358ec1ba0c81bf0498cdee4bd /spec/controllers/projects/commit_controller_spec.rb
parent2e3bc85421ddfc814e81f75e3adb8a8c1d53093e (diff)
parent58e2b44afe535100508eb4d49d7e7df24e408383 (diff)
downloadgitlab-ce-feature/improve-mrwbs-and-todos-for-pipelines.tar.gz
Merge branch 'master' into feature/improve-mrwbs-and-todos-for-pipelinesfeature/improve-mrwbs-and-todos-for-pipelines
* master: Update health_check gem to `~> 2.2.0` API: Version information Revert "Merge branch 'tests-use-tmpfs' into 'master'" Added documentation chapter for Git attributes Use activerecord_sane_schema_dumper Add a separate stage for bundle check Add a bundle check step to ensure dependencies are correct Create a new /templates API namespace Add disabled delete button to protected branches Make spec deterministic refactors tests because of gitlab-test repository changes Addresses Robert's feedback Speed up specs for GET /projects/:id/events API: New /users/:id/events endpoint writes tests to verify the issue is solved and fixes breaking issues. removes inconsistency regarding tagging immediately as merged once you create a branch using new branch button and adds changelog entry
Diffstat (limited to 'spec/controllers/projects/commit_controller_spec.rb')
-rw-r--r--spec/controllers/projects/commit_controller_spec.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/spec/controllers/projects/commit_controller_spec.rb b/spec/controllers/projects/commit_controller_spec.rb
index 7e440193d7b..646b097d74e 100644
--- a/spec/controllers/projects/commit_controller_spec.rb
+++ b/spec/controllers/projects/commit_controller_spec.rb
@@ -102,15 +102,16 @@ describe Projects::CommitController do
describe "as patch" do
include_examples "export as", :patch
let(:format) { :patch }
+ let(:commit2) { project.commit('498214de67004b1da3d820901307bed2a68a8ef6') }
it "is a git email patch" do
- go(id: commit.id, format: format)
+ go(id: commit2.id, format: format)
- expect(response.body).to start_with("From #{commit.id}")
+ expect(response.body).to start_with("From #{commit2.id}")
end
it "contains a git diff" do
- go(id: commit.id, format: format)
+ go(id: commit2.id, format: format)
expect(response.body).to match(/^diff --git/)
end
@@ -135,6 +136,8 @@ describe Projects::CommitController do
describe "GET branches" do
it "contains branch and tags information" do
+ commit = project.commit('5937ac0a7beb003549fc5fd26fc247adbce4a52e')
+
get(:branches,
namespace_id: project.namespace.to_param,
project_id: project.to_param,
@@ -254,16 +257,17 @@ describe Projects::CommitController do
end
let(:existing_path) { '.gitmodules' }
+ let(:commit2) { project.commit('5937ac0a7beb003549fc5fd26fc247adbce4a52e') }
context 'when the commit exists' do
context 'when the user has access to the project' do
context 'when the path exists in the diff' do
it 'enables diff notes' do
- diff_for_path(id: commit.id, old_path: existing_path, new_path: existing_path)
+ diff_for_path(id: commit2.id, old_path: existing_path, new_path: existing_path)
expect(assigns(:diff_notes_disabled)).to be_falsey
expect(assigns(:comments_target)).to eq(noteable_type: 'Commit',
- commit_id: commit.id)
+ commit_id: commit2.id)
end
it 'only renders the diffs for the path given' do
@@ -272,7 +276,7 @@ describe Projects::CommitController do
meth.call(diffs)
end
- diff_for_path(id: commit.id, old_path: existing_path, new_path: existing_path)
+ diff_for_path(id: commit2.id, old_path: existing_path, new_path: existing_path)
end
end