Fix specs
This commit is contained in:
parent
faa2e2df8f
commit
c927bc3ffa
|
@ -407,7 +407,6 @@ describe Repository, models: true do
|
||||||
|
|
||||||
context "when an author is specified" do
|
context "when an author is specified" do
|
||||||
it "uses the given email/name to set the commit's author" do
|
it "uses the given email/name to set the commit's author" do
|
||||||
|
|
||||||
expect do
|
expect do
|
||||||
repository.update_file(user, 'README', 'Updated README!',
|
repository.update_file(user, 'README', 'Updated README!',
|
||||||
branch_name: 'master',
|
branch_name: 'master',
|
||||||
|
|
|
@ -127,7 +127,7 @@ describe API::Files, api: true do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns a 400 if editor fails to create file" do
|
it "returns a 400 if editor fails to create file" do
|
||||||
allow_any_instance_of(Repository).to receive(:commit_file).
|
allow_any_instance_of(Repository).to receive(:create_file).
|
||||||
and_return(false)
|
and_return(false)
|
||||||
|
|
||||||
post api("/projects/#{project.id}/repository/files", user), valid_params
|
post api("/projects/#{project.id}/repository/files", user), valid_params
|
||||||
|
@ -215,7 +215,7 @@ describe API::Files, api: true do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns a 400 if fails to create file" do
|
it "returns a 400 if fails to create file" do
|
||||||
allow_any_instance_of(Repository).to receive(:remove_file).and_return(false)
|
allow_any_instance_of(Repository).to receive(:delete_file).and_return(false)
|
||||||
|
|
||||||
delete api("/projects/#{project.id}/repository/files", user), valid_params
|
delete api("/projects/#{project.id}/repository/files", user), valid_params
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue