[DRE-commits] [ruby-omniauth-crowd] 01/03: port tests to webmock 3

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Fri Sep 22 08:46:08 UTC 2017


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository ruby-omniauth-crowd.

commit 153ea11f2a09349ffacbed4f5dba4a7cd6d1e6f8
Author: Pirate Praveen <praveen at debian.org>
Date:   Fri Sep 22 13:52:13 2017 +0530

    port tests to webmock 3
---
 debian/patches/port-to-webmock3.patch | 64 +++++++++++++++++++++++++++++++++++
 debian/patches/series                 |  1 +
 2 files changed, 65 insertions(+)

diff --git a/debian/patches/port-to-webmock3.patch b/debian/patches/port-to-webmock3.patch
new file mode 100644
index 0000000..1560def
--- /dev/null
+++ b/debian/patches/port-to-webmock3.patch
@@ -0,0 +1,64 @@
+From 0092fe6f1c1750c51d9943d1afc2597f158c97e2 Mon Sep 17 00:00:00 2001
+From: kp <krishnaprasad at hatio.co>
+Date: Fri, 22 Sep 2017 13:12:17 +0530
+Subject: [PATCH] fix spec for webmock3
+
+---
+ omniauth_crowd.gemspec                 |  2 +-
+ spec/omniauth/strategies/crowd_spec.rb | 32 ++++++++++++++++----------------
+ 2 files changed, 17 insertions(+), 17 deletions(-)
+
+--- a/omniauth_crowd.gemspec
++++ b/omniauth_crowd.gemspec
+@@ -24,6 +24,6 @@
+   gem.add_development_dependency(%q<rake>, [">= 0"])
+   gem.add_development_dependency(%q<rack-test>, [">= 0"])
+   gem.add_development_dependency(%q<rspec>, ["~> 3.0.0"])
+-  gem.add_development_dependency(%q<webmock>)
++  gem.add_development_dependency(%q<webmock>, ["~> 3.0.0"])
+   gem.add_development_dependency(%q<bundler>, ["> 1.0.0"])
+ end
+--- a/spec/omniauth/strategies/crowd_spec.rb
++++ b/spec/omniauth/strategies/crowd_spec.rb
+@@ -85,14 +85,14 @@
+   describe 'GET /auth/crowd/callback with credentials can be successful' do
+     context "when using authentication endpoint" do
+       before do
+-        stub_request(:post, "https://bogus_app:bogus_app_password@crowd.example.org/rest/usermanagement/latest/authentication?username=foo").
++        stub_request(:post, "https://crowd.example.org/rest/usermanagement/latest/authentication?username=foo").
+         to_return(:body => File.read(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'success.xml')))
+ 
+-        stub_request(:get, "https://bogus_app:bogus_app_password@crowd.example.org/rest/usermanagement/latest/user/group/direct?username=foo").
++        stub_request(:get, "https://crowd.example.org/rest/usermanagement/latest/user/group/direct?username=foo").
+             to_return(:body => File.read(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'groups.xml')))
+ 
+         #Adding this to prevent Content-Type text/xml from being added back in the future
+-        stub_request(:get, "https://bogus_app:bogus_app_password@crowd.example.org/rest/usermanagement/latest/user/group/direct?username=foo").with(:headers => {"Content-Type" => "text/xml"}).
++        stub_request(:get, "https://crowd.example.org/rest/usermanagement/latest/user/group/direct?username=foo").with(:headers => {"Content-Type" => "text/xml"}).
+             to_return(:status => [415, "Unsupported Media Type"])
+         get '/auth/crowd/callback', nil, 'rack.session'=>{'omniauth.crowd'=> {"username"=>"foo", "password"=>"ba"}}
+       end
+@@ -115,11 +115,11 @@
+     describe "when using session endpoint" do
+       before do
+         @using_sessions = true
+-        stub_request(:post, "https://bogus_app:bogus_app_password@crowd.example.org/rest/usermanagement/latest/authentication?username=foo").
++        stub_request(:post, "https://crowd.example.org/rest/usermanagement/latest/authentication?username=foo").
+           to_return(:body => File.read(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'success.xml')))
+-        stub_request(:post, "https://bogus_app:bogus_app_password@crowd.example.org/rest/usermanagement/latest/session").
++        stub_request(:post, "https://crowd.example.org/rest/usermanagement/latest/session").
+           to_return(:status => 201, :body => File.read(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'session.xml')))
+-        stub_request(:get, "https://bogus_app:bogus_app_password@crowd.example.org/rest/usermanagement/latest/user/group/direct?username=foo").
++        stub_request(:get, "https://crowd.example.org/rest/usermanagement/latest/user/group/direct?username=foo").
+           to_return(:body => File.read(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'groups.xml')))
+       end
+ 
+@@ -149,7 +149,7 @@
+ 
+   describe 'GET /auth/crowd/callback with credentials will fail' do
+     before do
+-      stub_request(:post, "https://bogus_app:bogus_app_password@crowd.example.org/rest/usermanagement/latest/authentication?username=foo").
++      stub_request(:post, "https://crowd.example.org/rest/usermanagement/latest/authentication?username=foo").
+       to_return(:headers => {"Code" => "400"})
+       get '/auth/crowd/callback', nil, 'rack.session'=>{'omniauth.crowd'=> {"username"=>"foo", "password"=>"ba"}}
+     end
diff --git a/debian/patches/series b/debian/patches/series
index 220c29f..d8451f1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 remove-bundler.patch
 fix-test-header.patch
+port-to-webmock3.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-omniauth-crowd.git



More information about the Pkg-ruby-extras-commits mailing list