RubyApp 0.6.32 → 0.6.33
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ruby_app/elements/mobile/documents/authentication/facebook/authentication_document.rb +0 -4
- data/lib/ruby_app/elements/mobile/documents/authentication/o_auth/authentication_document.rb +1 -7
- data/lib/ruby_app/elements/mobile/documents/authentication/o_auth/git_hub_authentication_document.rb +6 -0
- data/lib/ruby_app/scripts/all_once.rb +1 -0
- data/lib/ruby_app/scripts/elements/authentications/facebook.rb +8 -0
- data/lib/ruby_app/version.rb +1 -1
- metadata +4 -3
data/lib/ruby_app/elements/mobile/documents/authentication/o_auth/authentication_document.rb
CHANGED
@@ -39,9 +39,7 @@ module RubyApp
|
|
39
39
|
code = RubyApp::Request.query['code']
|
40
40
|
access_token = @client.auth_code.get_token(code, :redirect_uri => RubyApp::Request.url)
|
41
41
|
RubyApp::Log.debug("OAUTH token=#{access_token.token.inspect}")
|
42
|
-
|
43
|
-
RubyApp::Log.debug("OAUTH user=#{user.inspect}")
|
44
|
-
RubyApp::Session.identity = self.create_identity_from_user(user)
|
42
|
+
RubyApp::Session.identity = self.create_identity_from_access_token(access_token)
|
45
43
|
RubyApp::Session.documents.pop
|
46
44
|
event.go('/')
|
47
45
|
end
|
@@ -49,10 +47,6 @@ module RubyApp
|
|
49
47
|
|
50
48
|
end
|
51
49
|
|
52
|
-
def create_identity_from_user(user)
|
53
|
-
RubyApp::Session::Identity.new(user['email'])
|
54
|
-
end
|
55
|
-
|
56
50
|
end
|
57
51
|
|
58
52
|
end
|
data/lib/ruby_app/elements/mobile/documents/authentication/o_auth/git_hub_authentication_document.rb
CHANGED
@@ -26,6 +26,12 @@ module RubyApp
|
|
26
26
|
super(access_key, secret_key, _scope, _options)
|
27
27
|
end
|
28
28
|
|
29
|
+
def create_identity_from_access_token(access_token)
|
30
|
+
user = JSON.parse(access_token.get('/user').body)
|
31
|
+
RubyApp::Log.debug("GITHUB user=#{user.inspect}")
|
32
|
+
RubyApp::Session.identity = RubyApp::Session::Identity.new(user['email'])
|
33
|
+
end
|
34
|
+
|
29
35
|
end
|
30
36
|
|
31
37
|
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
load_script! 'common/features/authentications'
|
2
|
+
|
3
|
+
add_step! (RubyApp::Element::Event) { |event| event.assert_exists_link('Facebook') }
|
4
|
+
#add_step! (RubyApp::Element::AssertedEvent) { |event| event.click_link('Facebook') }
|
5
|
+
#add_step! (RubyApp::Elements::Mobile::Page::LoadedEvent) { |event| event.assert_exists_text('You are logged in as') }
|
6
|
+
add_step! (RubyApp::Element::AssertedEvent) { |event| event.click_link('Back') }
|
7
|
+
add_step! (RubyApp::Elements::Mobile::Page::ShownEvent) { |event| event.click_link('Back') }
|
8
|
+
add_step! (RubyApp::Elements::Mobile::Page::ShownEvent) { |event| event.execute {} }
|
data/lib/ruby_app/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: RubyApp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 69
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 33
|
10
|
+
version: 0.6.33
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Frank G. Ficnar
|
@@ -585,6 +585,7 @@ files:
|
|
585
585
|
- lib/ruby_app/scripts/common/features/authentications.rb
|
586
586
|
- lib/ruby_app/scripts/common/reset.rb
|
587
587
|
- lib/ruby_app/scripts/default.rb
|
588
|
+
- lib/ruby_app/scripts/elements/authentications/facebook.rb
|
588
589
|
- lib/ruby_app/scripts/elements/authentications/o_auth/git_hub.rb
|
589
590
|
- lib/ruby_app/scripts/elements/buttons.rb
|
590
591
|
- lib/ruby_app/scripts/elements/calendars/month.rb
|