Skip to content

Commit

Permalink
Update tests for create_tags method so it more closely matches what w…
Browse files Browse the repository at this point in the history
…ill happen in Gitlab 7.5.0.
  • Loading branch information
asedge committed Nov 14, 2014
1 parent 76e29e6 commit 13a550c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions spec/fixtures/annotated_tag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name": "v1.1.0","message": "Release 1.1.0","commit": {"id": "2695effb5807a22ff3d138d593fd856244e155e7","parents": [],"message": "Initial commit","authored_date": "2012-05-28T04:42:42-07:00","author_name": "John Smith","author email": "john@example.com","committer_name": "Jack Smith","committed_date": "2012-05-28T04:42:42-07:00","committer_email": "jack@example.com"}}
1 change: 1 addition & 0 deletions spec/fixtures/lightweight_tag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name": "v1.0.0","message": null,"commit": {"id": "2695effb5807a22ff3d138d593fd856244e155e7","parents": [],"message": "Initial commit","authored_date": "2012-05-28T04:42:42-07:00","author_name": "John Smith","author email": "john@example.com","committer_name": "Jack Smith","committed_date": "2012-05-28T04:42:42-07:00","committer_email": "jack@example.com"}}
1 change: 0 additions & 1 deletion spec/fixtures/tag.json

This file was deleted.

10 changes: 6 additions & 4 deletions spec/gitlab/client/repositories_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
describe ".create_tag" do
context "lightweight" do
before do
stub_post("/projects/3/repository/tags", "tag")
stub_post("/projects/3/repository/tags", "lightweight_tag")
@tag = Gitlab.create_tag(3, 'v1.0.0', '2695effb5807a22ff3d138d593fd856244e155e7')
end

Expand All @@ -38,21 +38,23 @@

it "should return information about a new repository tag" do
expect(@tag.name).to eq("v1.0.0")
expect(@tag.message).to eq(nil)
end
end

context "annotated" do
before do
stub_post("/projects/3/repository/tags", "tag")
@tag = Gitlab.create_tag(3, 'v1.0.0', '2695effb5807a22ff3d138d593fd856244e155e7', 'this is an annotated tag')
stub_post("/projects/3/repository/tags", "annotated_tag")
@tag = Gitlab.create_tag(3, 'v1.1.0', '2695effb5807a22ff3d138d593fd856244e155e7', 'Release 1.1.0')
end

it "should get the correct resource" do
expect(a_post("/projects/3/repository/tags")).to have_been_made
end

it "should return information about a new repository tag" do
expect(@tag.name).to eq("v1.0.0")
expect(@tag.name).to eq("v1.1.0")
expect(@tag.message).to eq("Release 1.1.0")
end
end
end
Expand Down

0 comments on commit 13a550c

Please sign in to comment.