orcid 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/app/controllers/orcid/application_controller.rb +8 -1
- data/app/controllers/orcid/profile_connections_controller.rb +2 -1
- data/app/controllers/orcid/profile_requests_controller.rb +18 -1
- data/app/models/orcid/profile_connection.rb +1 -1
- data/app/models/orcid/profile_request.rb +9 -1
- data/app/models/orcid/profile_status.rb +5 -1
- data/app/services/orcid/profile_request_coordinator.rb +4 -4
- data/app/views/orcid/profile_connections/_authenticated_connection.html.erb +1 -3
- data/app/views/orcid/profile_connections/_orcid_connector.html.erb +4 -1
- data/app/views/orcid/profile_connections/_pending_connection.html.erb +8 -9
- data/app/views/orcid/profile_connections/_profile_request_in_error.html.erb +30 -0
- data/app/views/orcid/profile_connections/_profile_request_pending.html.erb +6 -3
- data/app/views/orcid/profile_connections/new.html.erb +3 -3
- data/app/views/orcid/profile_requests/show.html.erb +1 -5
- data/config/locales/orcid.en.yml +25 -5
- data/config/routes.rb +1 -1
- data/lib/orcid.rb +6 -0
- data/lib/orcid/version.rb +1 -1
- data/orcid.gemspec +1 -0
- data/spec/controllers/orcid/application_controller_spec.rb +15 -0
- data/spec/controllers/orcid/profile_requests_controller_spec.rb +18 -0
- data/spec/features/non_ui_based_interactions_spec.rb +1 -0
- data/spec/lib/orcid_spec.rb +17 -0
- data/spec/models/orcid/profile_connection_spec.rb +10 -12
- data/spec/models/orcid/profile_request_spec.rb +10 -2
- data/spec/models/orcid/profile_status_spec.rb +17 -5
- data/spec/services/orcid/profile_request_coordinator_spec.rb +6 -6
- data/spec/spec_helper.rb +12 -0
- data/spec/views/orcid/profile_connections/_orcid_connector.html.erb_spec.rb +12 -1
- data/spec/views/orcid/profile_connections/_profile_request_in_error.html.erb_spec.rb +21 -0
- metadata +80 -61
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d66cd54bd576ea08eb376f44610131ac480ba6b5
|
4
|
+
data.tar.gz: f483169f3bd055e2fb58b6328e8e9e553965a630
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 414235bdc885e4223581f787f078e417d83428c6363cd370a4535c5cc9577cee21ac6dbe049e437541f3b3fe6f864055a8f078e6c89e5ad3c040dad211f265af
|
7
|
+
data.tar.gz: a91a0f0236f4e29b988db18d947c057a917ae4a6e70a16dbd294101aa50c6cead16fcea0bddbf2c9d08d49ebfc9b00943629d2af4157f148b652fa1ff07e399d
|
data/README.md
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
[![Build Status](https://travis-ci.org/projecthydra-labs/orcid.png?branch=master)](https://travis-ci.org/projecthydra-labs/orcid)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/projecthydra-labs/orcid.png)](https://codeclimate.com/github/projecthydra-labs/orcid)
|
6
6
|
[![Coverage Status](https://img.shields.io/coveralls/projecthydra-labs/orcid.svg)](https://coveralls.io/r/projecthydra-labs/orcid)
|
7
|
+
[![Documentation Status](http://inch-ci.org/github/projecthydra-labs/orcid.svg?branch=master)](http://inch-ci.org/github/projecthydra-labs/orcid)
|
7
8
|
[![API Docs](http://img.shields.io/badge/API-docs-blue.svg)](http://rubydoc.info/gems/orcid/0.8.0/frames)
|
8
9
|
[![APACHE 2 License](http://img.shields.io/badge/APACHE2-license-blue.svg)](./LICENSE)
|
9
10
|
[![Contributing Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md)
|
@@ -1,6 +1,13 @@
|
|
1
1
|
module Orcid
|
2
2
|
# The foundation for Orcid controllers. A few helpful accessors.
|
3
3
|
class ApplicationController < Orcid.parent_controller.constantize
|
4
|
+
# Providing a mechanism for overrding the default path in an implementing
|
5
|
+
# application
|
6
|
+
def path_for(named_path, *args)
|
7
|
+
return send(named_path, *args).to_s if respond_to?(named_path)
|
8
|
+
yield(*args)
|
9
|
+
end
|
10
|
+
|
4
11
|
private
|
5
12
|
|
6
13
|
def redirecting_because_user_has_connected_orcid_profile
|
@@ -9,7 +16,7 @@ module Orcid
|
|
9
16
|
'orcid.requests.messages.previously_connected_profile',
|
10
17
|
orcid_profile_id: orcid_profile.orcid_profile_id
|
11
18
|
)
|
12
|
-
redirect_to main_app.root_path
|
19
|
+
redirect_to path_for(:orcid_settings_path) { main_app.root_path }
|
13
20
|
return true
|
14
21
|
else
|
15
22
|
return false
|
@@ -72,7 +72,8 @@ module Orcid
|
|
72
72
|
'orcid.connections.messages.verified_profile_connection_exists',
|
73
73
|
orcid_profile_id: orcid_profile.orcid_profile_id
|
74
74
|
)
|
75
|
-
|
75
|
+
location = path_for(:orcid_settings_path) { main_app.root_path }
|
76
|
+
redirect_to(location, flash: { notice: notice })
|
76
77
|
end
|
77
78
|
end
|
78
79
|
end
|
@@ -36,12 +36,29 @@ module Orcid
|
|
36
36
|
#
|
37
37
|
# Thus we need to pass the location.
|
38
38
|
if new_profile_request.valid?
|
39
|
-
|
39
|
+
flash[:notice] = I18n.t(
|
40
|
+
'orcid.requests.messages.profile_request_created'
|
41
|
+
)
|
42
|
+
|
43
|
+
location = path_for(:after_successful_orcid_profile_request_path) do
|
44
|
+
orcid.profile_request_path
|
45
|
+
end
|
46
|
+
|
47
|
+
respond_with(orcid, location: location)
|
40
48
|
else
|
41
49
|
respond_with(orcid, new_profile_request)
|
42
50
|
end
|
43
51
|
end
|
44
52
|
|
53
|
+
def destroy
|
54
|
+
existing_profile_request.destroy if existing_profile_request
|
55
|
+
flash[:notice] = I18n.t('orcid.requests.messages.profile_request_destroyed')
|
56
|
+
location = path_for(:after_orcid_profile_request_destroyed_path) do
|
57
|
+
orcid.new_profile_request_path
|
58
|
+
end
|
59
|
+
respond_with(orcid, location: location)
|
60
|
+
end
|
61
|
+
|
45
62
|
protected
|
46
63
|
|
47
64
|
def redirecting_because_no_profile_request_was_found
|
@@ -11,7 +11,7 @@ module Orcid
|
|
11
11
|
|
12
12
|
# See: http://support.orcid.org/knowledgebase/articles/132354-tutorial-searching-with-the-api
|
13
13
|
class_attribute :available_query_attribute_names
|
14
|
-
self.available_query_attribute_names = [:
|
14
|
+
self.available_query_attribute_names = [:text]
|
15
15
|
|
16
16
|
available_query_attribute_names.each do |attribute_name|
|
17
17
|
attribute attribute_name
|
@@ -4,6 +4,7 @@ module Orcid
|
|
4
4
|
# * submitting a request for an ORCID Profile
|
5
5
|
# * handling the response for the ORCID Profile creation
|
6
6
|
class ProfileRequest < ActiveRecord::Base
|
7
|
+
ERROR_STATUS = 'error'.freeze
|
7
8
|
def self.find_by_user(user)
|
8
9
|
where(user: user).first
|
9
10
|
end
|
@@ -25,8 +26,15 @@ module Orcid
|
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
28
|
-
def
|
29
|
+
def error_on_profile_creation(error_message)
|
29
30
|
update_column(:response_text, error_message)
|
31
|
+
update_column(:response_status, ERROR_STATUS)
|
32
|
+
end
|
33
|
+
|
34
|
+
alias_attribute :error_message, :response_text
|
35
|
+
|
36
|
+
def error_on_profile_creation?
|
37
|
+
error_message.present? || response_status == ERROR_STATUS
|
30
38
|
end
|
31
39
|
|
32
40
|
end
|
@@ -41,7 +41,11 @@ module Orcid
|
|
41
41
|
else
|
42
42
|
request = request_finder.call(user)
|
43
43
|
if request
|
44
|
-
|
44
|
+
if request.error_on_profile_creation?
|
45
|
+
return callback(:profile_request_in_error, request)
|
46
|
+
else
|
47
|
+
return callback(:profile_request_pending, request)
|
48
|
+
end
|
45
49
|
else
|
46
50
|
return callback(:unknown)
|
47
51
|
end
|
@@ -34,8 +34,8 @@ module Orcid
|
|
34
34
|
payload = xml_payload(profile_request)
|
35
35
|
remote_service.call(payload) do |on|
|
36
36
|
on.success { |orcid_profile_id| profile_request.successful_profile_creation(orcid_profile_id) }
|
37
|
-
on.failure { }
|
38
|
-
on.orcid_validation_error { |error_message| profile_request.
|
37
|
+
on.failure { profile_request }
|
38
|
+
on.orcid_validation_error { |error_message| profile_request.error_on_profile_creation(error_message) }
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -45,8 +45,8 @@ module Orcid
|
|
45
45
|
if !request.respond_to?(:user) || !request.user.present?
|
46
46
|
fail MissingUserForProfileRequest, request
|
47
47
|
end
|
48
|
-
if !request.respond_to?(:
|
49
|
-
raise ProfileRequestMethodExpectedError.new(request, :
|
48
|
+
if !request.respond_to?(:error_on_profile_creation)
|
49
|
+
raise ProfileRequestMethodExpectedError.new(request, :error_on_profile_creation)
|
50
50
|
end
|
51
51
|
if !request.respond_to?(:successful_profile_creation)
|
52
52
|
raise ProfileRequestMethodExpectedError.new(request, :successful_profile_creation)
|
@@ -1,5 +1,3 @@
|
|
1
1
|
<div class="authenticated-connection">
|
2
|
-
|
3
|
-
Your ORCID (<a class="orcid-profile-id" href="<%= Orcid.url_for_orcid_id(authenticated_connection.orcid_profile_id)%>" ><%= authenticated_connection.orcid_profile_id %></a>) has been authenticated for this application.
|
4
|
-
</p>
|
2
|
+
<%= t('orcid.views.authenticated_connection', orcid_profile_url: Orcid.url_for_orcid_id(authenticated_connection.orcid_profile_id), orcid_profile_id: authenticated_connection.orcid_profile_id).html_safe %>
|
5
3
|
</div>
|
@@ -1,7 +1,10 @@
|
|
1
1
|
<% defined?(status_processor) || status_processor = Orcid::ProfileStatus.method(:for) %>
|
2
2
|
<div class='orcid-connector'>
|
3
|
-
<h3><i class="icon-user"></i> <%= link_to t('orcid.verbose_name'),
|
3
|
+
<h3><i class="icon-user"></i> <%= link_to t('orcid.verbose_name'), Orcid.provider.host_url %></h3>
|
4
4
|
<% status_processor.call(current_user) do |on|%>
|
5
|
+
<% on.profile_request_in_error do |pending_request| %>
|
6
|
+
<%= render partial: 'orcid/profile_connections/profile_request_in_error', object: pending_request %>
|
7
|
+
<% end %>
|
5
8
|
<% on.profile_request_pending do |pending_request| %>
|
6
9
|
<%= render partial: 'orcid/profile_connections/profile_request_pending', object: pending_request %>
|
7
10
|
<% end %>
|
@@ -1,11 +1,10 @@
|
|
1
1
|
<div class="pending-connection">
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
</p>
|
2
|
+
<%= t(
|
3
|
+
'orcid.views.pending_connection',
|
4
|
+
orcid_profile_url: Orcid.url_for_orcid_id(pending_connection.orcid_profile_id),
|
5
|
+
orcid_profile_id: pending_connection.orcid_profile_id,
|
6
|
+
application_orcid_authorization_href: user_omniauth_authorize_path(provider: 'orcid'),
|
7
|
+
application_orcid_authorization_text: 'sign into this application'
|
8
|
+
).html_safe
|
9
|
+
%>
|
11
10
|
</div>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<div class="profile-request-error">
|
2
|
+
<div class="orcid-request">
|
3
|
+
<h3>We have the following request on record</h3>
|
4
|
+
<dl>
|
5
|
+
<dt>Given Names</dt>
|
6
|
+
<dd><%= profile_request_in_error.given_names %></dd>
|
7
|
+
<dt>Family Name</dt>
|
8
|
+
<dd><%= profile_request_in_error.family_name %></dd>
|
9
|
+
<dt>Primary Email</dt>
|
10
|
+
<dd><%= profile_request_in_error.primary_email %></dd>
|
11
|
+
<dt>Reqeusted At</dt>
|
12
|
+
<dd><time datetime='<%= profile_request_in_error.created_at.in_time_zone %>'><%= time_ago_in_words(profile_request_in_error.created_at) %></time> ago.</dd>
|
13
|
+
<dt>Requested By</dt>
|
14
|
+
<dd><%= profile_request_in_error.user %></dd>
|
15
|
+
</dl>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="orcid-response">
|
19
|
+
<h3>ORCID responded with</h3>
|
20
|
+
<blockquote class="error-message"><%= profile_request_in_error.error_message %></blockquote
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<div class="orcid-actions">
|
24
|
+
<%= link_to(
|
25
|
+
t('orcid/profile_connection.profile_request_destroy', scope: 'helpers.label'),
|
26
|
+
orcid.profile_request_path ,
|
27
|
+
class: 'btn cancel-profile-request', method: :delete
|
28
|
+
) %>
|
29
|
+
</div>
|
30
|
+
</div>
|
@@ -1,5 +1,8 @@
|
|
1
1
|
<div class="profile-request-pending">
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
<%= t(
|
3
|
+
'orcid.views.profile_request_pending',
|
4
|
+
datetime: profile_request_pending.created_at.in_time_zone,
|
5
|
+
time_ago_in_words: time_ago_in_words(profile_request_pending.created_at)
|
6
|
+
).html_safe
|
7
|
+
%>
|
5
8
|
</div>
|
@@ -1,17 +1,17 @@
|
|
1
1
|
<%= simple_form_for(profile_connection, as: :profile_connection, url: orcid.new_profile_connection_path, method: :get, html: {class: 'search-form'}) do |f| %>
|
2
|
-
<%= field_set_tag(
|
2
|
+
<%= field_set_tag(t('orcid.views.profile_connections.fieldsets.search_orcid_profiles')) do %>
|
3
3
|
<% profile_connection.available_query_attribute_names.each do |field_name| %>
|
4
4
|
<%= f.input field_name, as: :search %>
|
5
5
|
<% end %>
|
6
6
|
<% end %>
|
7
7
|
<button type="submit" class="search-submit btn btn-primary" id="keyword-search-submit" tabindex="2">
|
8
|
-
<i class="icon-search icon-white"></i><span
|
8
|
+
<i class="icon-search icon-white"></i><span><%= t('orcid.views.profile_connections.buttons.search') %></span>
|
9
9
|
</button>
|
10
10
|
<% end %>
|
11
11
|
|
12
12
|
<% profile_connection.with_orcid_profile_candidates do |candidates| %>
|
13
13
|
<%= simple_form_for(profile_connection, as: :profile_connection, url: orcid.profile_connections_path,) do |f| %>
|
14
|
-
<%= field_set_tag(
|
14
|
+
<%= field_set_tag(t('orcid.views.profile_connections.fieldsets.select_an_orcid_profile')) do %>
|
15
15
|
<%= f.collection_radio_buttons :orcid_profile_id, candidates, :id, :label %>
|
16
16
|
<% end %>
|
17
17
|
<%= f.submit %>
|
@@ -1,5 +1 @@
|
|
1
|
-
|
2
|
-
<p><strong>Given names:</strong> <%= profile_request.given_names %></p>
|
3
|
-
<p><strong>Family name:</strong> <%= profile_request.family_name %></p>
|
4
|
-
<p><strong>Primary email:</strong> <%= profile_request.primary_email %></p>
|
5
|
-
<p><strong>ORCID Profile ID:</strong> <%= profile_request.orcid_profile_id %></p>
|
1
|
+
<% render partial: 'orcid/profile_connections/profile_request_in_error', object: profile_request %>
|
data/config/locales/orcid.en.yml
CHANGED
@@ -23,14 +23,33 @@ en:
|
|
23
23
|
orcid:
|
24
24
|
requests:
|
25
25
|
messages:
|
26
|
-
existing_request_not_found: "Unable to find an existing
|
27
|
-
existing_request: "You have already submitted an
|
28
|
-
previously_connected_profile: "You have already connected to an
|
26
|
+
existing_request_not_found: "Unable to find an existing orcid Profile request. Go ahead and create one."
|
27
|
+
existing_request: "You have already submitted an ORCID Profile request."
|
28
|
+
previously_connected_profile: "You have already connected to an ORCID Profile (%{orcid_profile_id})."
|
29
|
+
profile_request_created: "Your ORCID profile request has been submitted. Check your email for more information from ORCID."
|
30
|
+
profile_request_created: "Your ORCID profile request has been submitted. Check your email for more information from ORCID."
|
31
|
+
profile_request_destroyed: "Your ORCID profile request has been cancelled."
|
29
32
|
connections:
|
30
33
|
messages:
|
31
|
-
profile_connection_not_found: "Unable to find an existing
|
32
|
-
verified_profile_connection_exists: "You have already connected and verified your
|
34
|
+
profile_connection_not_found: "Unable to find an existing ORCID Profile connection."
|
35
|
+
verified_profile_connection_exists: "You have already connected and verified your ORCID Profile (%{orcid_profile_id})."
|
33
36
|
verbose_name: Open Researcher and Contributor ID (ORCID)
|
37
|
+
views:
|
38
|
+
profile_connections:
|
39
|
+
fieldsets:
|
40
|
+
search_orcid_profiles: "Search ORCID Profiles"
|
41
|
+
select_an_orcid_profile: "Select an ORCID Profile"
|
42
|
+
buttons:
|
43
|
+
search: 'Search'
|
44
|
+
authenticated_connection: "<p>Your ORCID (<a class='orcid-profile-id' href='%{orcid_profile_url}'>%{orcid_profile_id}</a>) has been authenticated for this application.</p>"
|
45
|
+
profile_request_pending: "<p>We are processing your ORCID Profile Request. It was submitted <time datetime='%{datetime}'>%{time_ago_in_words}</time> ago.</p>"
|
46
|
+
pending_connection: >
|
47
|
+
<p>You have an ORCID (<a class="orcid-profile-id" href="%{orcid_profile_url}">%{orcid_profile_id}</a>).</p>
|
48
|
+
<p>However, your ORCID has not been verified by this system. There are a few possibilities:</p>
|
49
|
+
<ul>
|
50
|
+
<li>You may not have claimed your ORCID. <a class="find-out-more" href="http://support.orcid.org/knowledgebase/articles/164480-creating-claiming-new-records">Find out more about claiming your ORCID.</a></li>
|
51
|
+
<li>You have claimed your ORCID, but have not used it to <a class="signin-via-orcid" href="%{application_orcid_authorization_href}">%{application_orcid_authorization_text}</a>.</li>
|
52
|
+
</ul>
|
34
53
|
helpers:
|
35
54
|
label:
|
36
55
|
orcid/profile_connection:
|
@@ -38,3 +57,4 @@ en:
|
|
38
57
|
create_an_orcid: Create an ORCID
|
39
58
|
look_up_your_existing_orcid: Look up your existing ORCID
|
40
59
|
connect_button_text: Connect
|
60
|
+
profile_request_destroy: Cancel your ORCID request
|
data/config/routes.rb
CHANGED
data/lib/orcid.rb
CHANGED
@@ -62,6 +62,12 @@ module Orcid
|
|
62
62
|
return false
|
63
63
|
end
|
64
64
|
|
65
|
+
def disconnect_user_and_orcid_profile(user)
|
66
|
+
authentication_model.where(provider: 'orcid', user: user).destroy_all
|
67
|
+
Orcid::ProfileRequest.where(user: user).destroy_all
|
68
|
+
true
|
69
|
+
end
|
70
|
+
|
65
71
|
def profile_for(user)
|
66
72
|
auth = authentication_model.where(provider: 'orcid', user: user).first
|
67
73
|
auth && Orcid::Profile.new(auth.uid)
|
data/lib/orcid/version.rb
CHANGED
data/orcid.gemspec
CHANGED
@@ -47,6 +47,7 @@ Gem::Specification.new do |s|
|
|
47
47
|
s.add_development_dependency 'rspec-html-matchers', '~> 0.5.0'
|
48
48
|
s.add_development_dependency 'capybara'
|
49
49
|
s.add_development_dependency 'capybara-webkit'
|
50
|
+
s.add_development_dependency 'headless'
|
50
51
|
s.add_development_dependency 'webmock'
|
51
52
|
s.add_development_dependency 'simplecov'
|
52
53
|
s.add_development_dependency 'rest_client'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Orcid::ApplicationController, type: :controller do
|
4
|
+
context '#path_for' do
|
5
|
+
it 'yields when the provided symbol is not a method' do
|
6
|
+
path_for = controller.path_for(:__obviously_missing_method__, '123') { |arg| "/abc/#{arg}" }
|
7
|
+
expect(path_for).to eq('/abc/123')
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'calls the named method' do
|
11
|
+
path_for = controller.path_for(:to_s) { "/abc/#{arg}" }
|
12
|
+
expect(path_for).to eq(controller.to_s)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -101,6 +101,7 @@ module Orcid
|
|
101
101
|
expect do
|
102
102
|
post :create, profile_request: profile_request_attributes, use_route: :orcid
|
103
103
|
end.to change { Orcid::ProfileRequest.count }.by(1)
|
104
|
+
expect(flash[:notice]).to eq(I18n.t('orcid.requests.messages.profile_request_created'))
|
104
105
|
expect(response).to redirect_to(orcid.profile_request_path)
|
105
106
|
end
|
106
107
|
|
@@ -124,5 +125,22 @@ module Orcid
|
|
124
125
|
|
125
126
|
end
|
126
127
|
end
|
128
|
+
|
129
|
+
context 'DELETE #destroy' do
|
130
|
+
it_prompts_unauthenticated_users_for_signin(:delete, :destroy)
|
131
|
+
context 'authenticated and authorized user' do
|
132
|
+
before { sign_in(user) }
|
133
|
+
|
134
|
+
it 'should destroy any pending profile requests' do
|
135
|
+
profile_request = double(destroy: true)
|
136
|
+
Orcid::ProfileRequest.should_receive(:find_by_user).with(user).and_return(profile_request)
|
137
|
+
|
138
|
+
delete :destroy, use_route: :orcid
|
139
|
+
expect(flash[:notice]).to eq(I18n.t('orcid.requests.messages.profile_request_destroyed'))
|
140
|
+
expect(profile_request).to have_received(:destroy)
|
141
|
+
expect(response).to redirect_to(orcid.new_profile_request_path)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
127
145
|
end
|
128
146
|
end
|
@@ -131,6 +131,7 @@ describe 'non-UI based interactions' , requires_net_connect: true do
|
|
131
131
|
def mailinator_requests(uri)
|
132
132
|
base_sleep_duration = ENV.fetch('MAILINATOR_SECONDS_TO_RETRY', 120).to_i
|
133
133
|
retry_attempts = ENV.fetch('MAILINATOR_RETRY_ATTEMPTS', 6).to_i
|
134
|
+
$stdout.print "\n=-=-= Fetching the mail from #{uri}"
|
134
135
|
(0...retry_attempts).each do |attempt|
|
135
136
|
sleep_duration = base_sleep_duration * (attempt +1)
|
136
137
|
$stdout.print "\n=-=-= Connecting to Mailinator. Attempt #{attempt+1}\n\tWaiting #{sleep_duration} seconds to connect: "
|
data/spec/lib/orcid_spec.rb
CHANGED
@@ -60,6 +60,23 @@ describe Orcid do
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
+
context '.disconnect_user_and_orcid_profile' do
|
64
|
+
it 'changes the authentication count' do
|
65
|
+
Orcid.connect_user_and_orcid_profile(user, orcid_profile_id)
|
66
|
+
expect { Orcid.disconnect_user_and_orcid_profile(user) }.
|
67
|
+
to change(Orcid.authentication_model, :count).by(-1)
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'deletes any profile request' do
|
71
|
+
Orcid::ProfileRequest.create!(
|
72
|
+
user: user, given_names: 'Hello', family_name: 'World',
|
73
|
+
primary_email: 'hello@world.com', primary_email_confirmation: 'hello@world.com'
|
74
|
+
)
|
75
|
+
expect { Orcid.disconnect_user_and_orcid_profile(user) }.
|
76
|
+
to change(Orcid::ProfileRequest, :count).by(-1)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
63
80
|
context '.access_token_for' do
|
64
81
|
let(:client) { double("Client")}
|
65
82
|
let(:token) { double('Token') }
|
@@ -4,21 +4,21 @@ require 'orcid/profile_connection'
|
|
4
4
|
# :nodoc:
|
5
5
|
module Orcid
|
6
6
|
describe ProfileConnection do
|
7
|
-
let(:
|
7
|
+
let(:text) { 'test@hello.com' }
|
8
8
|
let(:dois) { '123' }
|
9
9
|
let(:user) { double('User') }
|
10
10
|
let(:profile_query_service) { double('Profile Lookup Service') }
|
11
11
|
let(:persister) { double('Persister') }
|
12
12
|
|
13
13
|
subject do
|
14
|
-
Orcid::ProfileConnection.new(
|
14
|
+
Orcid::ProfileConnection.new(text: text, user: user).tap do |pc|
|
15
15
|
pc.persister = persister
|
16
16
|
pc.profile_query_service = profile_query_service
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
its(:default_persister) { should respond_to(:call) }
|
21
|
-
its(:
|
21
|
+
its(:text) { should eq text }
|
22
22
|
its(:to_model) { should eq subject }
|
23
23
|
its(:user) { should eq user }
|
24
24
|
its(:persisted?) { should eq false }
|
@@ -26,20 +26,18 @@ module Orcid
|
|
26
26
|
|
27
27
|
context '.available_query_attribute_names' do
|
28
28
|
subject { Orcid::ProfileConnection.new.available_query_attribute_names }
|
29
|
-
it { should include(:email) }
|
30
29
|
it { should include(:text) }
|
31
|
-
it { should include(:digital_object_ids) }
|
32
30
|
end
|
33
31
|
|
34
32
|
context '#query_attributes' do
|
35
33
|
subject do
|
36
34
|
Orcid::ProfileConnection.new(
|
37
|
-
|
35
|
+
text: text, user: user, digital_object_ids: dois
|
38
36
|
)
|
39
37
|
end
|
40
38
|
its(:query_attributes) do
|
41
39
|
should eq(
|
42
|
-
'
|
40
|
+
'text' => text
|
43
41
|
)
|
44
42
|
end
|
45
43
|
end
|
@@ -50,7 +48,7 @@ module Orcid
|
|
50
48
|
its(:query_requested?) { should eq false }
|
51
49
|
end
|
52
50
|
context 'with attribute set' do
|
53
|
-
subject { Orcid::ProfileConnection.new(
|
51
|
+
subject { Orcid::ProfileConnection.new(text: text, user: user) }
|
54
52
|
its(:query_requested?) { should eq true }
|
55
53
|
end
|
56
54
|
end
|
@@ -76,10 +74,10 @@ module Orcid
|
|
76
74
|
end
|
77
75
|
|
78
76
|
context '#with_orcid_profile_candidates' do
|
79
|
-
context 'with an
|
77
|
+
context 'with an text' do
|
80
78
|
|
81
79
|
it 'should yield the query response' do
|
82
|
-
subject.
|
80
|
+
subject.text = text
|
83
81
|
|
84
82
|
profile_query_service.
|
85
83
|
should_receive(:call).
|
@@ -91,9 +89,9 @@ module Orcid
|
|
91
89
|
end
|
92
90
|
end
|
93
91
|
|
94
|
-
context 'without an
|
92
|
+
context 'without an text' do
|
95
93
|
it 'should not yield' do
|
96
|
-
subject.
|
94
|
+
subject.text = nil
|
97
95
|
profile_query_service.stub(:call).and_return(:query_response)
|
98
96
|
|
99
97
|
expect { |b| subject.with_orcid_profile_candidates(&b) }.
|
@@ -37,12 +37,20 @@ module Orcid
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
context '#
|
40
|
+
context '#error_on_profile_creation' do
|
41
41
|
it 'should update profile request' do
|
42
42
|
error_message = '123'
|
43
43
|
# Don't want to hit the database
|
44
44
|
subject.should_receive(:update_column).with(:response_text, error_message)
|
45
|
-
subject.
|
45
|
+
subject.should_receive(:update_column).with(:response_status, ProfileRequest::ERROR_STATUS)
|
46
|
+
subject.error_on_profile_creation(error_message)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context '#error_on_profile_creation?' do
|
51
|
+
it 'should be true if there is a response text' do
|
52
|
+
subject.response_status = ProfileRequest::ERROR_STATUS
|
53
|
+
expect(subject.error_on_profile_creation?).to be_truthy
|
46
54
|
end
|
47
55
|
end
|
48
56
|
end
|
@@ -12,7 +12,8 @@ module Orcid
|
|
12
12
|
:unknown,
|
13
13
|
:authenticated_connection,
|
14
14
|
:pending_connection,
|
15
|
-
:profile_request_pending
|
15
|
+
:profile_request_pending,
|
16
|
+
:profile_request_in_error
|
16
17
|
)
|
17
18
|
end
|
18
19
|
Given(:subject) do
|
@@ -55,11 +56,22 @@ module Orcid
|
|
55
56
|
|
56
57
|
context 'and does not have a profile' do
|
57
58
|
context 'but has submitted a request' do
|
58
|
-
Given(:request) { double('ProfileRequest') }
|
59
|
+
Given(:request) { double('ProfileRequest', :error_on_profile_creation? => error_on_creation) }
|
59
60
|
Given(:request_finder) { double('RequestFinder', call: request) }
|
60
|
-
|
61
|
-
|
62
|
-
|
61
|
+
|
62
|
+
context "and there weren't problems with the request" do
|
63
|
+
Given(:error_on_creation) { false }
|
64
|
+
When(:status) { subject.status }
|
65
|
+
Then { expect(status).to eq :profile_request_pending }
|
66
|
+
And { expect(callback.invoked).to eq [:profile_request_pending, request] }
|
67
|
+
end
|
68
|
+
|
69
|
+
context "and there were problems with the request" do
|
70
|
+
Given(:error_on_creation) { true }
|
71
|
+
When(:status) { subject.status }
|
72
|
+
Then { expect(status).to eq :profile_request_in_error }
|
73
|
+
And { expect(callback.invoked).to eq [:profile_request_in_error, request] }
|
74
|
+
end
|
63
75
|
end
|
64
76
|
context 'user does not have a request' do
|
65
77
|
When(:status) { subject.status }
|
@@ -8,7 +8,7 @@ module Orcid
|
|
8
8
|
end
|
9
9
|
Given(:logger) { double('Logger', notice: true) }
|
10
10
|
Given(:user) { 'user' }
|
11
|
-
Given(:profile_request) { double('ProfileRequest', user: user, successful_profile_creation: true,
|
11
|
+
Given(:profile_request) { double('ProfileRequest', user: user, successful_profile_creation: true, error_on_profile_creation: true) }
|
12
12
|
Given(:remote_service) { double('Remote Service') }
|
13
13
|
Given(:callback_responder) do
|
14
14
|
double('Responder', unknown: true, authenticated_connection: true, profile_request_pending: true, pending_connection: true)
|
@@ -39,7 +39,7 @@ module Orcid
|
|
39
39
|
Given(:remote_service_handler) { double('Handler', success: true, failure: true, orcid_validation_error: true) }
|
40
40
|
Given(:attributes) { { given_names: 'Given', family_name: 'Family', primary_email: 'email@email.email' } }
|
41
41
|
Given(:profile_request) do
|
42
|
-
double('ProfileRequest', user: user, attributes: attributes, successful_profile_creation: true,
|
42
|
+
double('ProfileRequest', user: user, attributes: attributes, successful_profile_creation: true, error_on_profile_creation: true)
|
43
43
|
end
|
44
44
|
before do
|
45
45
|
callback_responder.stub(:profile_request_pending).and_yield(profile_request)
|
@@ -60,7 +60,7 @@ module Orcid
|
|
60
60
|
end
|
61
61
|
Given(:error_message) { 'Error Message' }
|
62
62
|
When { coordinator.call }
|
63
|
-
Then { expect(profile_request).to have_received(:
|
63
|
+
Then { expect(profile_request).to have_received(:error_on_profile_creation).with(error_message) }
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
@@ -70,14 +70,14 @@ module Orcid
|
|
70
70
|
Then { expect(instantiation).to have_failed(MissingUserForProfileRequest) }
|
71
71
|
end
|
72
72
|
|
73
|
-
context 'requires a
|
73
|
+
context 'requires a error_on_profile_creation for the profile_request' do
|
74
74
|
Given(:profile_request) { double('ProfileRequest', user: 'user') }
|
75
75
|
When(:instantiation) { described_class.new(profile_request) }
|
76
76
|
Then { expect(instantiation).to have_failed(ProfileRequestMethodExpectedError) }
|
77
77
|
end
|
78
78
|
|
79
|
-
context 'requires a
|
80
|
-
Given(:profile_request) { double('ProfileRequest', user: 'user',
|
79
|
+
context 'requires a error_on_profile_creation for the profile_request' do
|
80
|
+
Given(:profile_request) { double('ProfileRequest', user: 'user', error_on_profile_creation: true) }
|
81
81
|
When(:instantiation) { described_class.new(profile_request) }
|
82
82
|
Then { expect(instantiation).to have_failed(ProfileRequestMethodExpectedError) }
|
83
83
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -33,6 +33,18 @@ require 'rspec-html-matchers'
|
|
33
33
|
require 'webmock/rspec'
|
34
34
|
require 'capybara'
|
35
35
|
require 'capybara-webkit'
|
36
|
+
require 'headless'
|
37
|
+
|
38
|
+
Capybara.register_driver :webkit do |app|
|
39
|
+
Capybara::Webkit::Driver.new(app, :ignore_ssl_errors => true)
|
40
|
+
end
|
41
|
+
|
42
|
+
Capybara.javascript_driver = :webkit
|
43
|
+
|
44
|
+
if ENV['TRAVIS'] || ENV['JENKINS']
|
45
|
+
headless = Headless.new
|
46
|
+
headless.start
|
47
|
+
end
|
36
48
|
|
37
49
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
38
50
|
# in spec/support/ and its subdirectories.
|
@@ -10,7 +10,8 @@ describe 'orcid/profile_connections/_orcid_connector.html.erb' do
|
|
10
10
|
profile_request_pending: true,
|
11
11
|
unknown: true,
|
12
12
|
authenticated_connection: true,
|
13
|
-
pending_connection: true
|
13
|
+
pending_connection: true,
|
14
|
+
profile_request_in_error: true
|
14
15
|
)
|
15
16
|
end
|
16
17
|
def render_with_params
|
@@ -42,6 +43,16 @@ describe 'orcid/profile_connections/_orcid_connector.html.erb' do
|
|
42
43
|
expect(rendered).to have_tag('.orcid-connector')
|
43
44
|
end
|
44
45
|
end
|
46
|
+
context 'with :profile_request_in_error status' do
|
47
|
+
let(:pending_request) { Orcid::ProfileRequest.new(created_at: Time.now) }
|
48
|
+
it 'renders the options to view the pending profile request' do
|
49
|
+
expect(handler).to receive(:profile_request_in_error).and_yield(pending_request)
|
50
|
+
render_with_params
|
51
|
+
|
52
|
+
expect(view).to render_template(partial: 'orcid/profile_connections/_profile_request_in_error')
|
53
|
+
expect(rendered).to have_tag('.orcid-connector')
|
54
|
+
end
|
55
|
+
end
|
45
56
|
context 'with :authenticated_connection status' do
|
46
57
|
let(:profile) { double('Profile', orcid_profile_id: '123-456') }
|
47
58
|
it 'renders the options to view the authenticated connection' do
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'orcid/profile_connections/_profile_request_in_error.html.erb' do
|
4
|
+
Given(:profile_request) { Orcid::ProfileRequest.new(error_message: 'Ouch!', created_at: created_at) }
|
5
|
+
Given(:created_at) { Date.today }
|
6
|
+
|
7
|
+
When(:rendered) do
|
8
|
+
render(
|
9
|
+
partial: 'orcid/profile_connections/profile_request_in_error',
|
10
|
+
object: profile_request
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
Then do
|
15
|
+
expect(rendered).to have_tag('.profile-request-error') do
|
16
|
+
with_tag('.error-message', text: 'Ouch!')
|
17
|
+
with_tag('.cancel-profile-request', with: { :href => orcid.profile_request_path, 'data-method' => 'delete' })
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
metadata
CHANGED
@@ -1,377 +1,391 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orcid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Friesen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: figaro
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: devise-multi_auth
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.1'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: omniauth-orcid
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: mappy
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: virtus
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: email_validator
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: simple_form
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - '>='
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - '>='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: sqlite3
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - '>='
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: engine_cart
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - '>='
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - '>='
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: rspec-rails
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - ~>
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '2.99'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - ~>
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '2.99'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: database_cleaner
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- -
|
171
|
+
- - '>='
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: '0'
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- -
|
178
|
+
- - '>='
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: factory_girl
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
|
-
- -
|
185
|
+
- - '>='
|
186
186
|
- !ruby/object:Gem::Version
|
187
187
|
version: '0'
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
|
-
- -
|
192
|
+
- - '>='
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: rspec-html-matchers
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
|
-
- -
|
199
|
+
- - ~>
|
200
200
|
- !ruby/object:Gem::Version
|
201
201
|
version: 0.5.0
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
|
-
- -
|
206
|
+
- - ~>
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: 0.5.0
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: capybara
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
|
-
- -
|
213
|
+
- - '>='
|
214
214
|
- !ruby/object:Gem::Version
|
215
215
|
version: '0'
|
216
216
|
type: :development
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
|
-
- -
|
220
|
+
- - '>='
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '0'
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: capybara-webkit
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
226
226
|
requirements:
|
227
|
-
- -
|
227
|
+
- - '>='
|
228
228
|
- !ruby/object:Gem::Version
|
229
229
|
version: '0'
|
230
230
|
type: :development
|
231
231
|
prerelease: false
|
232
232
|
version_requirements: !ruby/object:Gem::Requirement
|
233
233
|
requirements:
|
234
|
-
- -
|
234
|
+
- - '>='
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: headless
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - '>='
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0'
|
244
|
+
type: :development
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - '>='
|
235
249
|
- !ruby/object:Gem::Version
|
236
250
|
version: '0'
|
237
251
|
- !ruby/object:Gem::Dependency
|
238
252
|
name: webmock
|
239
253
|
requirement: !ruby/object:Gem::Requirement
|
240
254
|
requirements:
|
241
|
-
- -
|
255
|
+
- - '>='
|
242
256
|
- !ruby/object:Gem::Version
|
243
257
|
version: '0'
|
244
258
|
type: :development
|
245
259
|
prerelease: false
|
246
260
|
version_requirements: !ruby/object:Gem::Requirement
|
247
261
|
requirements:
|
248
|
-
- -
|
262
|
+
- - '>='
|
249
263
|
- !ruby/object:Gem::Version
|
250
264
|
version: '0'
|
251
265
|
- !ruby/object:Gem::Dependency
|
252
266
|
name: simplecov
|
253
267
|
requirement: !ruby/object:Gem::Requirement
|
254
268
|
requirements:
|
255
|
-
- -
|
269
|
+
- - '>='
|
256
270
|
- !ruby/object:Gem::Version
|
257
271
|
version: '0'
|
258
272
|
type: :development
|
259
273
|
prerelease: false
|
260
274
|
version_requirements: !ruby/object:Gem::Requirement
|
261
275
|
requirements:
|
262
|
-
- -
|
276
|
+
- - '>='
|
263
277
|
- !ruby/object:Gem::Version
|
264
278
|
version: '0'
|
265
279
|
- !ruby/object:Gem::Dependency
|
266
280
|
name: rest_client
|
267
281
|
requirement: !ruby/object:Gem::Requirement
|
268
282
|
requirements:
|
269
|
-
- -
|
283
|
+
- - '>='
|
270
284
|
- !ruby/object:Gem::Version
|
271
285
|
version: '0'
|
272
286
|
type: :development
|
273
287
|
prerelease: false
|
274
288
|
version_requirements: !ruby/object:Gem::Requirement
|
275
289
|
requirements:
|
276
|
-
- -
|
290
|
+
- - '>='
|
277
291
|
- !ruby/object:Gem::Version
|
278
292
|
version: '0'
|
279
293
|
- !ruby/object:Gem::Dependency
|
280
294
|
name: rspec-given
|
281
295
|
requirement: !ruby/object:Gem::Requirement
|
282
296
|
requirements:
|
283
|
-
- -
|
297
|
+
- - '>='
|
284
298
|
- !ruby/object:Gem::Version
|
285
299
|
version: '0'
|
286
300
|
type: :development
|
287
301
|
prerelease: false
|
288
302
|
version_requirements: !ruby/object:Gem::Requirement
|
289
303
|
requirements:
|
290
|
-
- -
|
304
|
+
- - '>='
|
291
305
|
- !ruby/object:Gem::Version
|
292
306
|
version: '0'
|
293
307
|
- !ruby/object:Gem::Dependency
|
294
308
|
name: rspec
|
295
309
|
requirement: !ruby/object:Gem::Requirement
|
296
310
|
requirements:
|
297
|
-
- -
|
311
|
+
- - ~>
|
298
312
|
- !ruby/object:Gem::Version
|
299
313
|
version: '2.99'
|
300
314
|
type: :development
|
301
315
|
prerelease: false
|
302
316
|
version_requirements: !ruby/object:Gem::Requirement
|
303
317
|
requirements:
|
304
|
-
- -
|
318
|
+
- - ~>
|
305
319
|
- !ruby/object:Gem::Version
|
306
320
|
version: '2.99'
|
307
321
|
- !ruby/object:Gem::Dependency
|
308
322
|
name: rspec-mocks
|
309
323
|
requirement: !ruby/object:Gem::Requirement
|
310
324
|
requirements:
|
311
|
-
- -
|
325
|
+
- - ~>
|
312
326
|
- !ruby/object:Gem::Version
|
313
327
|
version: '2.99'
|
314
328
|
type: :development
|
315
329
|
prerelease: false
|
316
330
|
version_requirements: !ruby/object:Gem::Requirement
|
317
331
|
requirements:
|
318
|
-
- -
|
332
|
+
- - ~>
|
319
333
|
- !ruby/object:Gem::Version
|
320
334
|
version: '2.99'
|
321
335
|
- !ruby/object:Gem::Dependency
|
322
336
|
name: rspec-core
|
323
337
|
requirement: !ruby/object:Gem::Requirement
|
324
338
|
requirements:
|
325
|
-
- -
|
339
|
+
- - ~>
|
326
340
|
- !ruby/object:Gem::Version
|
327
341
|
version: '2.99'
|
328
342
|
type: :development
|
329
343
|
prerelease: false
|
330
344
|
version_requirements: !ruby/object:Gem::Requirement
|
331
345
|
requirements:
|
332
|
-
- -
|
346
|
+
- - ~>
|
333
347
|
- !ruby/object:Gem::Version
|
334
348
|
version: '2.99'
|
335
349
|
- !ruby/object:Gem::Dependency
|
336
350
|
name: rspec-expectations
|
337
351
|
requirement: !ruby/object:Gem::Requirement
|
338
352
|
requirements:
|
339
|
-
- -
|
353
|
+
- - ~>
|
340
354
|
- !ruby/object:Gem::Version
|
341
355
|
version: '2.99'
|
342
356
|
type: :development
|
343
357
|
prerelease: false
|
344
358
|
version_requirements: !ruby/object:Gem::Requirement
|
345
359
|
requirements:
|
346
|
-
- -
|
360
|
+
- - ~>
|
347
361
|
- !ruby/object:Gem::Version
|
348
362
|
version: '2.99'
|
349
363
|
- !ruby/object:Gem::Dependency
|
350
364
|
name: rspec-its
|
351
365
|
requirement: !ruby/object:Gem::Requirement
|
352
366
|
requirements:
|
353
|
-
- -
|
367
|
+
- - '>='
|
354
368
|
- !ruby/object:Gem::Version
|
355
369
|
version: '0'
|
356
370
|
type: :development
|
357
371
|
prerelease: false
|
358
372
|
version_requirements: !ruby/object:Gem::Requirement
|
359
373
|
requirements:
|
360
|
-
- -
|
374
|
+
- - '>='
|
361
375
|
- !ruby/object:Gem::Version
|
362
376
|
version: '0'
|
363
377
|
- !ruby/object:Gem::Dependency
|
364
378
|
name: rspec-activemodel-mocks
|
365
379
|
requirement: !ruby/object:Gem::Requirement
|
366
380
|
requirements:
|
367
|
-
- -
|
381
|
+
- - '>='
|
368
382
|
- !ruby/object:Gem::Version
|
369
383
|
version: '0'
|
370
384
|
type: :development
|
371
385
|
prerelease: false
|
372
386
|
version_requirements: !ruby/object:Gem::Requirement
|
373
387
|
requirements:
|
374
|
-
- -
|
388
|
+
- - '>='
|
375
389
|
- !ruby/object:Gem::Version
|
376
390
|
version: '0'
|
377
391
|
description: A Rails engine for orcid.org integration.
|
@@ -381,11 +395,11 @@ executables: []
|
|
381
395
|
extensions: []
|
382
396
|
extra_rdoc_files: []
|
383
397
|
files:
|
384
|
-
-
|
385
|
-
-
|
386
|
-
-
|
387
|
-
-
|
388
|
-
-
|
398
|
+
- .coveralls.yml
|
399
|
+
- .gitignore
|
400
|
+
- .hound.yml
|
401
|
+
- .mailmap
|
402
|
+
- .travis.yml
|
389
403
|
- CONTRIBUTING.md
|
390
404
|
- Gemfile
|
391
405
|
- LICENSE
|
@@ -419,6 +433,7 @@ files:
|
|
419
433
|
- app/views/orcid/profile_connections/_options_to_connect_orcid_profile.html.erb
|
420
434
|
- app/views/orcid/profile_connections/_orcid_connector.html.erb
|
421
435
|
- app/views/orcid/profile_connections/_pending_connection.html.erb
|
436
|
+
- app/views/orcid/profile_connections/_profile_request_in_error.html.erb
|
422
437
|
- app/views/orcid/profile_connections/_profile_request_pending.html.erb
|
423
438
|
- app/views/orcid/profile_connections/new.html.erb
|
424
439
|
- app/views/orcid/profile_requests/new.html.erb
|
@@ -444,6 +459,7 @@ files:
|
|
444
459
|
- lib/tasks/orcid_tasks.rake
|
445
460
|
- orcid.gemspec
|
446
461
|
- script/fast_specs
|
462
|
+
- spec/controllers/orcid/application_controller_spec.rb
|
447
463
|
- spec/controllers/orcid/profile_connections_controller_spec.rb
|
448
464
|
- spec/controllers/orcid/profile_requests_controller_spec.rb
|
449
465
|
- spec/factories/orcid_profile_requests.rb
|
@@ -487,6 +503,7 @@ files:
|
|
487
503
|
- spec/views/orcid/profile_connections/_options_to_connect_orcid_profile.html.erb_spec.rb
|
488
504
|
- spec/views/orcid/profile_connections/_orcid_connector.html.erb_spec.rb
|
489
505
|
- spec/views/orcid/profile_connections/_pending_connection.html.erb_spec.rb
|
506
|
+
- spec/views/orcid/profile_connections/_profile_request_in_error.html.erb_spec.rb
|
490
507
|
- spec/views/orcid/profile_connections/_profile_request_pending.html.erb_spec.rb
|
491
508
|
- spec/views/orcid/profile_connections/new.html.erb_spec.rb
|
492
509
|
- spec/views/orcid/profile_requests/new.html.erb_spec.rb
|
@@ -501,12 +518,12 @@ require_paths:
|
|
501
518
|
- lib
|
502
519
|
required_ruby_version: !ruby/object:Gem::Requirement
|
503
520
|
requirements:
|
504
|
-
- -
|
521
|
+
- - '>='
|
505
522
|
- !ruby/object:Gem::Version
|
506
523
|
version: '0'
|
507
524
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
508
525
|
requirements:
|
509
|
-
- -
|
526
|
+
- - '>='
|
510
527
|
- !ruby/object:Gem::Version
|
511
528
|
version: '0'
|
512
529
|
requirements: []
|
@@ -516,6 +533,7 @@ signing_key:
|
|
516
533
|
specification_version: 4
|
517
534
|
summary: A Rails engine for orcid.org integration.
|
518
535
|
test_files:
|
536
|
+
- spec/controllers/orcid/application_controller_spec.rb
|
519
537
|
- spec/controllers/orcid/profile_connections_controller_spec.rb
|
520
538
|
- spec/controllers/orcid/profile_requests_controller_spec.rb
|
521
539
|
- spec/factories/orcid_profile_requests.rb
|
@@ -559,6 +577,7 @@ test_files:
|
|
559
577
|
- spec/views/orcid/profile_connections/_options_to_connect_orcid_profile.html.erb_spec.rb
|
560
578
|
- spec/views/orcid/profile_connections/_orcid_connector.html.erb_spec.rb
|
561
579
|
- spec/views/orcid/profile_connections/_pending_connection.html.erb_spec.rb
|
580
|
+
- spec/views/orcid/profile_connections/_profile_request_in_error.html.erb_spec.rb
|
562
581
|
- spec/views/orcid/profile_connections/_profile_request_pending.html.erb_spec.rb
|
563
582
|
- spec/views/orcid/profile_connections/new.html.erb_spec.rb
|
564
583
|
- spec/views/orcid/profile_requests/new.html.erb_spec.rb
|