radiant-reader-extension 3.0.27 → 3.0.28

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.
@@ -9,8 +9,9 @@ class ReaderActivationsController < ReaderActionController
9
9
  radiant_layout { |controller| Radiant::Config['reader.layout'] }
10
10
 
11
11
  # this is just fake REST: we're actually working on the reader, not an activation object.
12
- # .show sends out an activation message if we can identify the current reader
13
- # .update activates the reader, if the token is correct
12
+ # .new sends out an activation message, if we can identify the current reader
13
+ # .update updates the reader, if the supplied token and reader id match
14
+ # .show displays the activation in progress, ie it says 'check your email'
14
15
 
15
16
  def show
16
17
  expires_now
@@ -1,5 +1,5 @@
1
1
  module RadiantReaderExtension
2
- VERSION = '3.0.27'
2
+ VERSION = '3.0.28'
3
3
  SUMMARY = %q{Reader/viewer/visitor registration, login and access-control for Radiant CMS}
4
4
  DESCRIPTION = %q{Provides reader/member/user registration and management functions including password-reminder, group-based page access control and administrative email.}
5
5
  URL = "http://radiant.spanner.org/reader"
Binary file
@@ -27,6 +27,24 @@ describe ReaderActivationsController do
27
27
  end
28
28
  end
29
29
 
30
+ describe "with a homed group member" do
31
+ before do
32
+ @newreader = readers(:homed)
33
+ put :update, :id => @newreader.id, :activation_code => @newreader.perishable_token
34
+ @reader = Reader.find_by_name('Homed')
35
+ end
36
+
37
+ it "should activate the reader" do
38
+ @reader.activated?.should be_true
39
+ @reader.activated_at.should be_close((Time.now).utc, 1.minute)
40
+ end
41
+
42
+ it "should redirect to the right group home page" do
43
+ response.should be_redirect
44
+ response.should redirect_to(pages(:parent).path)
45
+ end
46
+ end
47
+
30
48
  describe "with an incorrect activation" do
31
49
  before do
32
50
  @newreader = readers(:inactive)
@@ -13,6 +13,7 @@ class ReadersDataset < Dataset::Base
13
13
  create_reader "Ungrouped"
14
14
  create_reader "User", :user_id => user_id(:existing)
15
15
  create_reader "Inactive", :activated_at => nil
16
+ create_reader "Homed", :activated_at => nil
16
17
 
17
18
  create_group "Normal"
18
19
  create_group "Special"
@@ -58,6 +59,7 @@ From <r:sender:name />
58
59
  admit_to_group :normal, [readers(:normal), readers(:inactive)]
59
60
  admit_to_group :special, [readers(:another)]
60
61
  admit_to_group :subgroup, [readers(:normal), readers(:another)]
62
+ admit_to_group :homed, [readers(:homed)]
61
63
 
62
64
  restrict_to_group :homed, [pages(:parent), pages(:childless)]
63
65
  restrict_to_group :special, [pages(:news)]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-reader-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
4
+ hash: 63
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
- - 27
10
- version: 3.0.27
9
+ - 28
10
+ version: 3.0.28
11
11
  platform: ruby
12
12
  authors:
13
13
  - William Ross
@@ -331,6 +331,7 @@ files:
331
331
  - public/stylesheets/sass/admin/reader.sass
332
332
  - public/stylesheets/sass/admin/reader_group.sass
333
333
  - public/stylesheets/sass/reader.sass
334
+ - radiant-reader-extension-3.0.27.gem
334
335
  - radiant-reader-extension.gemspec
335
336
  - Rakefile
336
337
  - reader_extension.rb
@@ -359,7 +360,7 @@ files:
359
360
  homepage: http://radiant.spanner.org/reader
360
361
  licenses: []
361
362
 
362
- post_install_message: "\n Add this to your radiant project with a line in your Gemfile:\n\n gem 'radiant-reader-extension', '~> 3.0.27'\n\n and if you haven't already, remember to enable ActionMailer in your\n project's config/environment.rb.\n "
363
+ post_install_message: "\n Add this to your radiant project with a line in your Gemfile:\n\n gem 'radiant-reader-extension', '~> 3.0.28'\n\n and if you haven't already, remember to enable ActionMailer in your\n project's config/environment.rb.\n "
363
364
  rdoc_options: []
364
365
 
365
366
  require_paths: