refinerycms-authentication-devise 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 823da86975ad68f17aa44db2bad3d1c5921612f1
4
- data.tar.gz: 464a8939c7ac8c49a9f342ffa470f8d230240a86
3
+ metadata.gz: d366fe2d246ffd1fd970498b9eb4b41af3d06794
4
+ data.tar.gz: 616c35d2dcc39b0126d5ab5628a5578cd7ee2c2c
5
5
  SHA512:
6
- metadata.gz: c1d7f23fc9e210bc0770b39eb10593aaec32bf842b48f1fb1423dc48f46339fb2c45fdf2477a937f036c61ab45be19abb17548e5b7bddbdac3142faffa7c434d
7
- data.tar.gz: 89fca6296c44a26f40e6ad0eea6b79373f7ea3ecc66b2b0a8bee2d9f94cff126545065de3fba34ea4ce49f4eb960d2378527e8ab77b9eb14fd9609e4e662e605
6
+ metadata.gz: 07be07aec37837f78a84e20c138d0bfd4d3f1659746f4d43e812a43aef1855da0bdebfd7ce3e5801390cbab878e8b215716fe6669aed1955a77c27916eab869d
7
+ data.tar.gz: a45d6a5fcf8bee5434a03ad3f5e5fc60c43ff84f83a98f1093fa5c254d08146f8e6df3d145bba3336c51b6d45af6d2e196841f8ac80bdb2bd4c1ca7ef73247e0
@@ -70,6 +70,10 @@ module Refinery
70
70
  )
71
71
  end
72
72
 
73
+ def has_plugin?(name)
74
+ active_plugins.names.include?(name)
75
+ end
76
+
73
77
  def authorised_plugins
74
78
  plugins.collect(&:name) | ::Refinery::Plugins.always_allowed.names
75
79
  end
@@ -0,0 +1,36 @@
1
+ # Contribution Guidelines #
2
+
3
+ ## Submitting a new issue ##
4
+
5
+ If you want to ensure that your issue gets fixed *fast* you should
6
+ attempt to reproduce the issue in an isolated example application that
7
+ you can share.
8
+
9
+ ## Running tests ##
10
+
11
+ Always run tests first. Quick start for tests (requires a dummy application) :
12
+
13
+ bundle install
14
+ bundle exec rake refinery:testing:dummy_app
15
+ bundle exec rake
16
+
17
+ ## Making a pull request ##
18
+
19
+ If you'd like to submit a pull request please adhere to the following:
20
+
21
+ 1. Your code *must* be tested. Please TDD your code!
22
+ 2. No single-character variables.
23
+ 3. Two-spaces instead of tabs.
24
+ 4. Double-quoted strings are fine for all use cases.
25
+ 5. General Rails/Ruby naming conventions for files and classes.
26
+ 6. Please add `[ci skip]` to your commit message for purely documentation changes **only**.
27
+
28
+ Please note that you must adhere to each of the above mentioned rules.
29
+ Failure to do so will result in an immediate closing of the pull
30
+ request. If you update and rebase the pull request to follow the
31
+ guidelines your pull request will be re-opened and considered for
32
+ inclusion.
33
+
34
+ ## Links ##
35
+
36
+ See also the [Contributing to Refinery](http://refinerycms.com/guides/contributing-to-refinery) guide.
@@ -52,7 +52,7 @@ module Refinery
52
52
  end
53
53
 
54
54
  def after_sign_out_path_for(resource_or_scope)
55
- refinery.root_path
55
+ refinery.login_path
56
56
  end
57
57
 
58
58
  protected :store_location, :pop_stored_location, :redirect_back_or_default,
data/readme.md CHANGED
@@ -7,5 +7,9 @@ This extension allows you to use Devise with Refinery CMS 3.0 and later.
7
7
  Simply put this in the Gemfile of your Refinery application:
8
8
 
9
9
  ```ruby
10
- gem 'refinerycms-authentication-devise', '~> 1.0.0'
10
+ gem 'refinerycms-authentication-devise', '~> 1.0.2'
11
11
  ```
12
+
13
+ ## Contributing
14
+
15
+ Please see the [contributing.md](contributing.md) file for instructions.
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  s.platform = Gem::Platform::RUBY
4
4
  s.name = %q{refinerycms-authentication-devise}
5
- s.version = %q{1.0.3}
5
+ s.version = %q{1.0.4}
6
6
  s.summary = %q{Devise based authentication extension for Refinery CMS}
7
7
  s.description = %q{A Devise authentication extension for Refinery CMS}
8
8
  s.homepage = %q{http://refinerycms.com}
@@ -101,3 +101,26 @@ describe 'redirects', :type => :feature do
101
101
  end
102
102
 
103
103
  end
104
+
105
+ describe "sign out", :type => :feature do
106
+ before do
107
+ FactoryGirl.create(:authentication_devise_refinery_user,
108
+ :username => "ugisozols",
109
+ :password => "123456",
110
+ :password_confirmation => "123456"
111
+ )
112
+ visit refinery.login_path
113
+ fill_in "Username or email", :with => "ugisozols"
114
+ fill_in "Password", :with => "123456"
115
+ click_button "Sign in"
116
+ end
117
+
118
+ context "when I sign out" do
119
+ before { click_on "Log out" }
120
+
121
+ it "redirects me back to the sign in page" do
122
+ expect(current_path).to eq(refinery.login_path)
123
+ expect(page).to have_content("Signed out successfully")
124
+ end
125
+ end
126
+ end
@@ -218,6 +218,22 @@ module Refinery
218
218
  end
219
219
  end
220
220
 
221
+ describe "#has_plugin?" do
222
+ before do
223
+ allow(user).to receive(:active_plugins).and_return(
224
+ OpenStruct.new(names: %w[koru haka])
225
+ )
226
+ end
227
+
228
+ it "is true when the user has an active plugin of the same name" do
229
+ expect(user.has_plugin?("koru")).to be_truthy
230
+ end
231
+
232
+ it "is false when the user doesn't have an active plugin of the same name" do
233
+ expect(user.has_plugin?("waiata")).to be_falsey
234
+ end
235
+ end
236
+
221
237
  describe "#authorised_plugins" do
222
238
  it "returns array of user and always allowed plugins" do
223
239
  ["refinery_one", "refinery_two", "refinery_three"].each_with_index do |name, index|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-authentication-devise
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Arndt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-23 00:00:00.000000000 Z
12
+ date: 2015-08-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: refinerycms-core
@@ -159,6 +159,7 @@ files:
159
159
  - config/locales/zh-CN.yml
160
160
  - config/locales/zh-TW.yml
161
161
  - config/routes.rb
162
+ - contributing.md
162
163
  - db/migrate/20100913234705_create_refinerycms_authentication_schema.rb
163
164
  - db/migrate/20120301234455_add_slug_to_refinery_users.rb
164
165
  - db/migrate/20130805143059_add_full_name_to_refinery_users.rb
@@ -208,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
209
  version: '0'
209
210
  requirements: []
210
211
  rubyforge_project:
211
- rubygems_version: 2.4.6
212
+ rubygems_version: 2.4.8
212
213
  signing_key:
213
214
  specification_version: 4
214
215
  summary: Devise based authentication extension for Refinery CMS