spec/gitlab/client/commits_spec.rb in gitlab-3.5.0 vs spec/gitlab/client/commits_spec.rb in gitlab-3.6.0

- old
+ new

@@ -10,21 +10,21 @@ it { should respond_to :repo_update_commit_status } describe ".commits" do before do stub_get("/projects/3/repository/commits", "project_commits"). - with(:query => {:ref_name => "api"}) - @commits = Gitlab.commits(3, :ref_name => "api") + with(query: { ref_name: "api" }) + @commits = Gitlab.commits(3, ref_name: "api") end it "should get the correct resource" do expect(a_get("/projects/3/repository/commits"). - with(:query => {:ref_name => "api"})).to have_been_made + with(query: { ref_name: "api" })).to have_been_made end - it "should return an array of repository commits" do - expect(@commits).to be_an Array + it "should return a paginated response of repository commits" do + expect(@commits).to be_a Gitlab::PaginatedResponse expect(@commits.first.id).to eq("f7dd067490fe57505f7226c3b54d3127d2f7fd46") end end describe ".commit" do @@ -32,12 +32,12 @@ stub_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6", "project_commit") @commit = Gitlab.commit(3, '6104942438c14ec7bd21c6cd5bd995272b3faff6') end it "should get the correct resource" do - expect(a_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6")) - .to have_been_made + expect(a_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6")). + to have_been_made end it "should return a repository commit" do expect(@commit.id).to eq("6104942438c14ec7bd21c6cd5bd995272b3faff6") end @@ -48,12 +48,12 @@ stub_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6/diff", "project_commit_diff") @diff = Gitlab.commit_diff(3, '6104942438c14ec7bd21c6cd5bd995272b3faff6') end it "should get the correct resource" do - expect(a_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6/diff")) - .to have_been_made + expect(a_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6/diff")). + to have_been_made end it "should return a diff of a commit" do expect(@diff.new_path).to eq("doc/update/5.4-to-6.0.md") end @@ -64,16 +64,16 @@ stub_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6/comments", "project_commit_comments") @commit_comments = Gitlab.commit_comments(3, '6104942438c14ec7bd21c6cd5bd995272b3faff6') end it "should get the correct resource" do - expect(a_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6/comments")) - .to have_been_made + expect(a_get("/projects/3/repository/commits/6104942438c14ec7bd21c6cd5bd995272b3faff6/comments")). + to have_been_made end it "should return commit's comments" do - expect(@commit_comments).to be_an Array + expect(@commit_comments).to be_a Gitlab::PaginatedResponse expect(@commit_comments.length).to eq(2) expect(@commit_comments[0].note).to eq("this is the 1st comment on commit 6104942438c14ec7bd21c6cd5bd995272b3faff6") expect(@commit_comments[0].author.id).to eq(11) expect(@commit_comments[1].note).to eq("another discussion point on commit 6104942438c14ec7bd21c6cd5bd995272b3faff6") expect(@commit_comments[1].author.id).to eq(12) @@ -99,15 +99,15 @@ @statuses = Gitlab.commit_status(6, '7d938cb8ac15788d71f4b67c035515a160ea76d8', all: true) end it "should get the correct resource" do expect(a_get("/projects/6/repository/commits/7d938cb8ac15788d71f4b67c035515a160ea76d8/statuses"). - with(query: {all: true})) + with(query: { all: true })) end it "should get statuses of a commit" do - expect(@statuses).to be_kind_of Array + expect(@statuses).to be_kind_of Gitlab::PaginatedResponse expect(@statuses.first.sha).to eq('7d938cb8ac15788d71f4b67c035515a160ea76d8') expect(@statuses.first.ref).to eq('decreased-spec') expect(@statuses.first.status).to eq('failed') expect(@statuses.last.sha).to eq('7d938cb8ac15788d71f4b67c035515a160ea76d8') expect(@statuses.last.status).to eq('success') @@ -115,16 +115,16 @@ end describe ".update_commit_status" do before do stub_post("/projects/6/statuses/7d938cb8ac15788d71f4b67c035515a160ea76d8", 'project_update_commit_status'). - with(query: {name: 'test', ref: 'decreased-spec', state: 'failed'}) + with(query: { name: 'test', ref: 'decreased-spec', state: 'failed' }) @status = Gitlab.update_commit_status(6, '7d938cb8ac15788d71f4b67c035515a160ea76d8', 'failed', name: 'test', ref: 'decreased-spec') end it "should get the correct resource" do expect(a_post('/projects/6/statuses/7d938cb8ac15788d71f4b67c035515a160ea76d8'). - with(query: {name: 'test', ref: 'decreased-spec', state: 'failed'})) + with(query: { name: 'test', ref: 'decreased-spec', state: 'failed' })) end it "should information about the newly created status" do expect(@status).to be_kind_of Gitlab::ObjectifiedHash expect(@status.id).to eq(498)