omniauth-zendesk 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,7 @@ module OmniAuth
26
26
  extra { { raw_info: identity } }
27
27
 
28
28
  def request_phase
29
+ return callback_phase if site && username && password
29
30
  OmniAuth::Form.build(
30
31
  title: (options[:title] || "Zendesk Authentication"),
31
32
  url: callback_path
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Zendesk
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -30,6 +30,18 @@ describe OmniAuth::Strategies::Zendesk do
30
30
  get '/auth/zendesk'
31
31
  last_response.body.should be_include("<form")
32
32
  end
33
+
34
+ context 'with valid credentials' do
35
+ before do
36
+ stub_request(:get, "https://john%40example.com:awesome@my.zendesk.com/api/v2/users/me").
37
+ to_return(status: 200, body: File.new(File.dirname(__FILE__) + '/../../fixtures/me.json'), headers: {content_type: "application/json; charset=utf-8"})
38
+ post '/auth/zendesk', email: 'john@example.com', password: 'awesome', site: 'my'
39
+ end
40
+
41
+ it 'should populate the auth hash' do
42
+ auth_hash.should be_kind_of(Hash)
43
+ end
44
+ end
33
45
  end
34
46
 
35
47
  describe '#callback_phase' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-zendesk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -142,7 +142,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  segments:
144
144
  - 0
145
- hash: 1456298723233117652
145
+ hash: -3124490689275656540
146
146
  required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  none: false
148
148
  requirements:
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  version: '0'
152
152
  segments:
153
153
  - 0
154
- hash: 1456298723233117652
154
+ hash: -3124490689275656540
155
155
  requirements: []
156
156
  rubyforge_project:
157
157
  rubygems_version: 1.8.24