|
116 | 116 | end |
117 | 117 |
|
118 | 118 | it "merge request status test success" do |
119 | | - http_stubs.post("api/v3/projects/hal%2Fhal9000/statuses/#{"0" * 40}") { |_env| [404, {}, ""] } |
| 119 | + http_stubs.post("api/v4/projects/hal%2Fhal9000/statuses/#{"0" * 40}") { |_env| [404, {}, ""] } |
120 | 120 |
|
121 | 121 | expect(receive_test({}, git_url: "ssh://git@gitlab.com/hal/hal9000.git")[:ok]).to eq(true) |
122 | 122 | end |
123 | 123 |
|
124 | 124 | it "merge request status test failure" do |
125 | | - http_stubs.post("api/v3/projects/hal%2Fhal9000/statuses/#{"0" * 40}") { |_env| [401, {}, ""] } |
| 125 | + http_stubs.post("api/v4/projects/hal%2Fhal9000/statuses/#{"0" * 40}") { |_env| [401, {}, ""] } |
126 | 126 |
|
127 | 127 | expect { receive_test({}, git_url: "ssh://git@gitlab.com/hal/hal9000.git") }.to raise_error(CC::Service::HTTPError) |
128 | 128 | end |
|
134 | 134 | end |
135 | 135 |
|
136 | 136 | it "different base url" do |
137 | | - http_stubs.post("api/v3/projects/hal%2Fhal9000/statuses/#{"0" * 40}") do |env| |
138 | | - expect(env[:url].to_s).to eq("https://gitlab.hal.org/api/v3/projects/hal%2Fhal9000/statuses/#{"0" * 40}") |
| 137 | + http_stubs.post("api/v4/projects/hal%2Fhal9000/statuses/#{"0" * 40}") do |env| |
| 138 | + expect(env[:url].to_s).to eq("https://gitlab.hal.org/api/v4/projects/hal%2Fhal9000/statuses/#{"0" * 40}") |
139 | 139 | [404, {}, ""] |
140 | 140 | end |
141 | 141 |
|
|
145 | 145 | private |
146 | 146 |
|
147 | 147 | def expect_status_update(repo, commit_sha, params) |
148 | | - http_stubs.post "api/v3/projects/#{CGI.escape(repo)}/statuses/#{commit_sha}" do |env| |
149 | | - expect(env[:request_headers]["PRIVATE-TOKEN"]).to eq("123") |
| 148 | + http_stubs.post "api/v4/projects/#{CGI.escape(repo)}/statuses/#{commit_sha}" do |env| |
| 149 | + expect(env[:request_headers]["Private-Token"]).to eq("123") |
150 | 150 |
|
151 | 151 | body = JSON.parse(env[:body]) |
152 | 152 |
|
|
0 commit comments