Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/files/update_service_spec.rb')
-rw-r--r--spec/services/files/update_service_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/services/files/update_service_spec.rb b/spec/services/files/update_service_spec.rb
index 6d7459e0b29..6a9f9d6b86f 100644
--- a/spec/services/files/update_service_spec.rb
+++ b/spec/services/files/update_service_spec.rb
@@ -2,7 +2,7 @@
require "spec_helper"
-RSpec.describe Files::UpdateService do
+RSpec.describe Files::UpdateService, feature_category: :source_code_management do
subject { described_class.new(project, user, commit_params) }
let(:project) { create(:project, :repository) }
@@ -31,8 +31,8 @@ RSpec.describe Files::UpdateService do
end
describe "#execute" do
- context "when the file's last commit sha does not match the supplied last_commit_sha" do
- let(:last_commit_sha) { "foo" }
+ context "when the file's last commit sha is earlier than the latest change for that branch" do
+ let(:last_commit_sha) { Gitlab::Git::Commit.last_for_path(project.repository, project.default_branch, file_path).parent_id }
it "returns a hash with the correct error message and a :error status" do
expect { subject.execute }