prooflink_connect 0.0.21 → 0.0.22
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +2 -0
- data/lib/prooflink_connect/version.rb +1 -1
- data/lib/prooflink_connect.rb +4 -2
- data/prooflink_connect.gemspec +2 -2
- data/spec/prooflink_connect/activity_spec.rb +10 -8
- data/spec/prooflink_connect/invite_spec.rb +2 -1
- data/spec/prooflink_connect_spec.rb +38 -14
- metadata +10 -6
- data/Gemfile.lock +0 -58
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/lib/prooflink_connect.rb
CHANGED
@@ -20,8 +20,10 @@ module ProoflinkConnect
|
|
20
20
|
def self.embedded(options = {}, config = ProoflinkConnect.config)
|
21
21
|
# needed because you didn't have to use px explicitly in the old situation
|
22
22
|
[:width, :height].each do |dimension|
|
23
|
-
if options[dimension]
|
24
|
-
|
23
|
+
next if options[dimension].nil?
|
24
|
+
value = options[dimension].to_s
|
25
|
+
if !value.match(/[%|px]/)
|
26
|
+
options[dimension] = value << "px"
|
25
27
|
end
|
26
28
|
end
|
27
29
|
|
data/prooflink_connect.gemspec
CHANGED
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.name = "prooflink_connect"
|
6
6
|
s.version = ProoflinkConnect::VERSION
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
|
-
s.authors = ["Chiel Wester", "Jermaine Oosterling"]
|
9
|
-
s.email = ["chiel.wester@holder.nl", "jermaine.oosterling@prooflink.com"]
|
8
|
+
s.authors = ["Chiel Wester", "Jermaine Oosterling", "Stephan Kaag", "Mark Mulder"]
|
9
|
+
s.email = ["chiel.wester@holder.nl", "jermaine.oosterling@prooflink.com", "stephan@ka.ag", "markmulder@gmail.com"]
|
10
10
|
s.homepage = "https://github.com/prooflink/prooflink_connect"
|
11
11
|
s.summary = "Make a connection to the prooflink connect api"
|
12
12
|
s.description = "Make a connection to the prooflink connect api for single sign on authentication"
|
@@ -7,14 +7,12 @@ describe ProoflinkConnect::Activity do
|
|
7
7
|
|
8
8
|
before do
|
9
9
|
stub_request(:post, "https://example.prooflink.com/api/v2/activities").
|
10
|
-
with(:headers => {'Accept'=>'*/*', 'Authorization'=>'OAuth 4321', 'Content-Type'=>'application/x-www-form-urlencoded'
|
11
|
-
to_return
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|
10
|
+
with(:body => {"activity"=>{"activity_type"=>{"name"=>"My name", "value"=>"1", "identifier"=>"my_identifier"}, "user"=>{"identity_provider"=>"prooflink", "email"=>"jon@doe.com"}}}, :headers => {'Accept'=>'*/*', 'Authorization'=>'OAuth 4321', 'Content-Type'=>'application/x-www-form-urlencoded'}).
|
11
|
+
to_return(:status => 200, :body => {"status"=>"SUCCESS", "message"=>"activity succesfully created"}.to_json, :headers => {})
|
12
|
+
|
13
|
+
stub_request(:post, "https://example.prooflink.com/api/v2/activities").
|
14
|
+
with(:body => "", :headers => {'Accept'=>'*/*', 'Authorization'=>'OAuth 4321', 'Content-Type'=>'application/x-www-form-urlencoded'}).
|
15
|
+
to_return(:status => 406, :body => {"status"=>"ERROR", "message"=>"no activity specified"}.to_json, :headers => {})
|
18
16
|
end
|
19
17
|
|
20
18
|
it "should log activity as expected" do
|
@@ -22,6 +20,10 @@ describe ProoflinkConnect::Activity do
|
|
22
20
|
:user => {:email => "jon@doe.com", :identity_provider => 'prooflink'}}
|
23
21
|
|
24
22
|
ProoflinkConnect::Activity.log(params).should eq({"status"=>"SUCCESS", "message"=>"activity succesfully created"})
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should not log activity when no params are passed" do
|
25
27
|
ProoflinkConnect::Activity.log({}).should eq({"status"=>"ERROR", "message"=>"no activity specified"})
|
26
28
|
end
|
27
29
|
end
|
@@ -7,9 +7,10 @@ describe ProoflinkConnect::Invite do
|
|
7
7
|
|
8
8
|
it "creates a Prooflink invite" do
|
9
9
|
attributes = {:email => 'newuser@prooflink.com'}
|
10
|
+
expected_parameters = {"locale"=>["nl"], "api_key"=>["1234"], "invite[email]"=>["newuser@prooflink.com"]}
|
10
11
|
|
11
12
|
stub_request(:post, "https://example.prooflink.com/invites").
|
12
|
-
with
|
13
|
+
with{|request| expected_parameters == CGI.parse(request.body)}.
|
13
14
|
to_return(:status => 200, :body => {
|
14
15
|
"entry" => {
|
15
16
|
"name" => {},
|
@@ -6,24 +6,48 @@ describe ProoflinkConnect do
|
|
6
6
|
ProoflinkConnect.embedded.should == result
|
7
7
|
end
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
context "width" do
|
10
|
+
it "allows integer" do
|
11
|
+
result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&use_popups=1' style='width: 100px; height: 250px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
|
12
|
+
ProoflinkConnect.embedded({:width => 100}).should == result
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
it "allows pixels" do
|
16
|
+
result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&use_popups=1' style='width: 100%; height: 250px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
|
17
|
+
ProoflinkConnect.embedded({:width => "100%"}).should == result
|
18
|
+
end
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
20
|
+
it "allows percentage" do
|
21
|
+
result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&use_popups=1' style='width: 100%; height: 250px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
|
22
|
+
ProoflinkConnect.embedded({:width => "100%"}).should == result
|
23
|
+
end
|
24
|
+
|
25
|
+
it "adds px if not given" do
|
26
|
+
result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&use_popups=1' style='width: 100px; height: 250px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
|
27
|
+
ProoflinkConnect.embedded({:width => "100"}).should == result
|
28
|
+
end
|
22
29
|
end
|
23
30
|
|
24
|
-
|
25
|
-
|
26
|
-
|
31
|
+
context "height" do
|
32
|
+
it "allows integer" do
|
33
|
+
result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&use_popups=1' style='width: 520px; height: 100px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
|
34
|
+
ProoflinkConnect.embedded({:height => 100}).should == result
|
35
|
+
end
|
36
|
+
|
37
|
+
it "allows pixels" do
|
38
|
+
result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&use_popups=1' style='width: 520px; height: 300px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
|
39
|
+
ProoflinkConnect.embedded({:height => "300px"}).should == result
|
40
|
+
end
|
41
|
+
|
42
|
+
it "allows percentage" do
|
43
|
+
result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&use_popups=1' style='width: 520px; height: 100%; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
|
44
|
+
ProoflinkConnect.embedded({:height => "100%"}).should == result
|
45
|
+
end
|
46
|
+
|
47
|
+
it "adds px if not given" do
|
48
|
+
result = "<iframe src='https://example.prooflink.com/authentications/embedded?token_url=https://example.com/auth/callbacks&use_popups=1' style='width: 520px; height: 100px; border: 0; display: block;' frameborder='0' allowTransparency='true'></iframe>"
|
49
|
+
ProoflinkConnect.embedded({:height => "100"}).should == result
|
50
|
+
end
|
27
51
|
end
|
28
52
|
|
29
53
|
it "sets split screen option" do
|
metadata
CHANGED
@@ -1,22 +1,24 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prooflink_connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 22
|
10
|
+
version: 0.0.22
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chiel Wester
|
14
14
|
- Jermaine Oosterling
|
15
|
+
- Stephan Kaag
|
16
|
+
- Mark Mulder
|
15
17
|
autorequire:
|
16
18
|
bindir: bin
|
17
19
|
cert_chain: []
|
18
20
|
|
19
|
-
date: 2012-
|
21
|
+
date: 2012-09-25 00:00:00 Z
|
20
22
|
dependencies:
|
21
23
|
- !ruby/object:Gem::Dependency
|
22
24
|
name: json
|
@@ -122,6 +124,8 @@ description: Make a connection to the prooflink connect api for single sign on a
|
|
122
124
|
email:
|
123
125
|
- chiel.wester@holder.nl
|
124
126
|
- jermaine.oosterling@prooflink.com
|
127
|
+
- stephan@ka.ag
|
128
|
+
- markmulder@gmail.com
|
125
129
|
executables: []
|
126
130
|
|
127
131
|
extensions: []
|
@@ -133,7 +137,6 @@ files:
|
|
133
137
|
- .rspec
|
134
138
|
- .travis.yml
|
135
139
|
- Gemfile
|
136
|
-
- Gemfile.lock
|
137
140
|
- README.md
|
138
141
|
- Rakefile
|
139
142
|
- lib/prooflink_connect.rb
|
@@ -185,9 +188,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
188
|
requirements: []
|
186
189
|
|
187
190
|
rubyforge_project: prooflink_connect
|
188
|
-
rubygems_version: 1.8.
|
191
|
+
rubygems_version: 1.8.12
|
189
192
|
signing_key:
|
190
193
|
specification_version: 3
|
191
194
|
summary: Make a connection to the prooflink connect api
|
192
195
|
test_files: []
|
193
196
|
|
197
|
+
has_rdoc:
|
data/Gemfile.lock
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
prooflink_connect (0.0.20)
|
5
|
-
activesupport
|
6
|
-
httparty
|
7
|
-
json
|
8
|
-
oauth2
|
9
|
-
|
10
|
-
GEM
|
11
|
-
remote: http://rubygems.org/
|
12
|
-
specs:
|
13
|
-
activesupport (3.2.7)
|
14
|
-
i18n (~> 0.6)
|
15
|
-
multi_json (~> 1.0)
|
16
|
-
addressable (2.2.8)
|
17
|
-
crack (0.3.1)
|
18
|
-
diff-lcs (1.1.3)
|
19
|
-
faraday (0.8.1)
|
20
|
-
multipart-post (~> 1.1)
|
21
|
-
httparty (0.8.3)
|
22
|
-
multi_json (~> 1.0)
|
23
|
-
multi_xml
|
24
|
-
httpauth (0.1)
|
25
|
-
i18n (0.6.0)
|
26
|
-
json (1.7.4)
|
27
|
-
jwt (0.1.5)
|
28
|
-
multi_json (>= 1.0)
|
29
|
-
multi_json (1.3.6)
|
30
|
-
multi_xml (0.5.1)
|
31
|
-
multipart-post (1.1.5)
|
32
|
-
oauth2 (0.8.0)
|
33
|
-
faraday (~> 0.8)
|
34
|
-
httpauth (~> 0.1)
|
35
|
-
jwt (~> 0.1.4)
|
36
|
-
multi_json (~> 1.0)
|
37
|
-
rack (~> 1.2)
|
38
|
-
rack (1.4.1)
|
39
|
-
rspec (2.11.0)
|
40
|
-
rspec-core (~> 2.11.0)
|
41
|
-
rspec-expectations (~> 2.11.0)
|
42
|
-
rspec-mocks (~> 2.11.0)
|
43
|
-
rspec-core (2.11.1)
|
44
|
-
rspec-expectations (2.11.2)
|
45
|
-
diff-lcs (~> 1.1.3)
|
46
|
-
rspec-mocks (2.11.1)
|
47
|
-
webmock (1.8.8)
|
48
|
-
addressable (~> 2.2.8)
|
49
|
-
crack (>= 0.1.7)
|
50
|
-
|
51
|
-
PLATFORMS
|
52
|
-
ruby
|
53
|
-
|
54
|
-
DEPENDENCIES
|
55
|
-
bundler (>= 1.0.0)
|
56
|
-
prooflink_connect!
|
57
|
-
rspec
|
58
|
-
webmock
|