thoughtbot-clearance 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -121,11 +121,6 @@ h2. Routes
121
121
 
122
122
  map.root :controller => 'sessions', :action => 'new'
123
123
 
124
- map.with_options :controller => 'sessions' do |m|
125
- m.login '/login', :action => 'new'
126
- m.logout '/logout', :action => 'destroy'
127
- end
128
-
129
124
  end
130
125
 
131
126
  h2. Environments
data/Rakefile CHANGED
@@ -33,7 +33,9 @@ namespace :gemspec do
33
33
  f.write spec.to_ruby
34
34
  end
35
35
  end
36
-
36
+ end
37
+
38
+ namespace :version do
37
39
  namespace :bump do
38
40
  desc "Bump the gemspec a major version."
39
41
  task :major do
@@ -51,8 +53,10 @@ end
51
53
  end
52
54
 
53
55
  spec.version = "#{major}.0.0"
56
+ puts "Version bumped to #{spec.version}"
57
+
54
58
  Rake::Task["gemspec:write"].invoke
55
- puts "Gem bumped to #{spec.version}"
59
+ puts "Gemspec updated"
56
60
  end
57
61
 
58
62
  desc "Bump the gemspec a minor version."
@@ -71,8 +75,10 @@ end
71
75
  end
72
76
 
73
77
  spec.version = "#{Clearance::Version::MAJOR}.#{minor}.0"
78
+ puts "Version bumped to #{spec.version}"
79
+
74
80
  Rake::Task["gemspec:write"].invoke
75
- puts "Gem bumped to #{spec.version}"
81
+ puts "Gemspec updated"
76
82
  end
77
83
 
78
84
  desc "Bump the gemspec a patch version."
@@ -91,8 +97,10 @@ end
91
97
  end
92
98
 
93
99
  spec.version = "#{Clearance::Version::MAJOR}.#{Clearance::Version::MINOR}.#{patch}"
100
+ puts "Version bumped to #{spec.version}"
101
+
94
102
  Rake::Task["gemspec:write"].invoke
95
- puts "Gem bumped to #{spec.version}"
103
+ puts "Gemspec updated"
96
104
  end
97
105
  end
98
106
  end
@@ -4,7 +4,6 @@
4
4
  # sessions controller test is missing some tests
5
5
  # mailers should not hardcode example.com as from address
6
6
  # check to make sure attr_accessible doesn't override and w/ attr_protected
7
- # helpers and tests shouldn't depend on login/logout routes
8
7
  # move shoulda macros in test_helper to shoulda_macros folder
9
8
  # add shoulda and factory girl dependencies to gemspec
10
9
  # refactor Mailer default_url_options[:host] to something cleaner
@@ -60,7 +60,7 @@ module Clearance
60
60
  end
61
61
 
62
62
  def deny_access(flash_message = nil, opts = {})
63
- opts[:redirect] ||= login_url
63
+ opts[:redirect] ||= new_session_url
64
64
  store_location
65
65
  flash[:error] = flash_message if flash_message
66
66
  redirect_to opts[:redirect]
@@ -22,7 +22,7 @@ module Clearance
22
22
  render :action => :new
23
23
  else
24
24
  UserMailer.deliver_change_password user
25
- redirect_to login_path
25
+ redirect_to new_session_url
26
26
  end
27
27
  end
28
28
 
@@ -66,7 +66,7 @@ module Clearance
66
66
  end
67
67
 
68
68
  def url_after_destroy
69
- login_url
69
+ new_session_url
70
70
  end
71
71
  end
72
72
  end
@@ -22,9 +22,9 @@ module Clearance
22
22
  def create
23
23
  @user = user_model.new params[:user]
24
24
  if @user.save
25
- current_user = @user
26
- flash[:notice] = "User created and logged in."
27
- redirect_back_or root_url
25
+ UserMailer.deliver_confirmation @user
26
+ flash[:notice] = "You will receive an email within the next few minutes. It contains instructions to confirm your account."
27
+ redirect_to new_session_url
28
28
  else
29
29
  render :action => "new"
30
30
  end
@@ -34,7 +34,7 @@ module Clearance
34
34
  module PrivateInstanceMethods
35
35
 
36
36
  def url_after_create
37
- root_url
37
+ new_session_url
38
38
  end
39
39
  end
40
40
 
@@ -38,7 +38,7 @@ module Clearance
38
38
  }
39
39
  end
40
40
 
41
- should_set_the_flash_to /created/i
41
+ should_set_the_flash_to /confirm/i
42
42
  should_redirect_to "@controller.send(:url_after_create)"
43
43
  should_assign_to :user
44
44
  should_change 'User.count', :by => 1
@@ -2,6 +2,6 @@ module Clearance
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- PATCH = 3
5
+ PATCH = 4
6
6
  end
7
7
  end
@@ -1,19 +1,14 @@
1
- ActionController::Routing::Routes.draw do |map|
2
-
3
- map.resources :users
4
- map.resource :session
5
-
6
- map.resources :users, :has_one => :password
7
- map.resources :users, :has_one => :confirmation
8
-
9
- map.resources :passwords
10
-
11
- map.root :controller => 'sessions', :action => 'new'
12
-
13
- map.with_options :controller => 'sessions' do |m|
14
- m.login '/login', :action => 'new'
15
- m.logout '/logout', :action => 'destroy'
16
- end
17
-
18
- end
1
+ ActionController::Routing::Routes.draw do |map|
2
+
3
+ map.resources :users
4
+ map.resource :session
5
+
6
+ map.resources :users, :has_one => :password
7
+ map.resources :users, :has_one => :confirmation
8
+
9
+ map.resources :passwords
10
+
11
+ map.root :controller => 'sessions', :action => 'new'
12
+
13
+ end
19
14
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thoughtbot-clearance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoughtbot, inc.