diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-06-21 14:53:21 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-06-21 14:53:21 +0200 |
commit | 354f8e1e6a6b6d738acebcd0e76568d178a4b8e4 (patch) | |
tree | e3944770e28906839ea77aec33faec29a8d0929b /spec/gitlab_net_spec.rb | |
parent | b262d92ef14e1c568c29dd58b7d3d1413f6c2b72 (diff) | |
parent | fa6343515ba65423e9de4c98c6005facc6059938 (diff) | |
download | gitlab-shell-354f8e1e6a6b6d738acebcd0e76568d178a4b8e4.tar.gz |
Merge branch 'master' into remove-references-to-v3-internal-api
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/gitlab_net_spec.rb')
-rw-r--r-- | spec/gitlab_net_spec.rb | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/spec/gitlab_net_spec.rb b/spec/gitlab_net_spec.rb index 9c9e6a1..34f3261 100644 --- a/spec/gitlab_net_spec.rb +++ b/spec/gitlab_net_spec.rb @@ -96,20 +96,13 @@ describe GitlabNet, vcr: true do describe :merge_request_urls do let(:gl_repository) { "project-1" } - let(:repo_path) { "/path/to/my/repo.git" } let(:changes) { "123456 789012 refs/heads/test\n654321 210987 refs/tags/tag" } let(:encoded_changes) { "123456%20789012%20refs/heads/test%0A654321%20210987%20refs/tags/tag" } it "sends the given arguments as encoded URL parameters" do - gitlab_net.should_receive(:get).with("#{host}/merge_request_urls?project=#{repo_path}&changes=#{encoded_changes}&gl_repository=#{gl_repository}") + gitlab_net.should_receive(:get).with("#{host}/merge_request_urls?gl_repository=#{gl_repository}&changes=#{encoded_changes}") - gitlab_net.merge_request_urls(gl_repository, repo_path, changes) - end - - it "omits the gl_repository parameter if it's nil" do - gitlab_net.should_receive(:get).with("#{host}/merge_request_urls?project=#{repo_path}&changes=#{encoded_changes}") - - gitlab_net.merge_request_urls(nil, repo_path, changes) + gitlab_net.merge_request_urls(gl_repository, changes) end end @@ -164,21 +157,20 @@ describe GitlabNet, vcr: true do describe '#notify_post_receive' do let(:gl_repository) { 'project-1' } - let(:repo_path) { '/path/to/my/repo.git' } let(:params) do - { gl_repository: gl_repository, project: repo_path } + { gl_repository: gl_repository } end it 'sets the arguments as form parameters' do VCR.use_cassette('notify-post-receive') do Net::HTTP::Post.any_instance.should_receive(:set_form_data).with(hash_including(params)) - gitlab_net.notify_post_receive(gl_repository, repo_path) + gitlab_net.notify_post_receive(gl_repository) end end it 'returns true if notification was succesful' do VCR.use_cassette('notify-post-receive') do - expect(gitlab_net.notify_post_receive(gl_repository, repo_path)).to be_true + expect(gitlab_net.notify_post_receive(gl_repository)).to be_true end end end |