diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-07-05 01:33:53 +0000 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-07-05 01:33:53 +0000 |
commit | e19ce03a1a785c2cf61d76b535bc6b32e0957606 (patch) | |
tree | e7989a18b757124db2d58cf1f96ac892bc59c219 /spec/gitlab_net_spec.rb | |
parent | 0a64624152735766c428d1532e434dd0bf5a9748 (diff) | |
download | gitlab-shell-revert-ffecea6a.tar.gz |
Revert "Merge branch 'revert-gl-repository' into 'master'"revert-ffecea6a
This reverts merge request !142
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 f3c67fd..eb2dd12 100644 --- a/spec/gitlab_net_spec.rb +++ b/spec/gitlab_net_spec.rb @@ -97,20 +97,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 @@ -165,21 +158,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 |