authpwn_rails 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/authpwn_rails.gemspec +5 -4
- data/lib/authpwn_rails/generators/session_generator.rb +2 -0
- data/lib/authpwn_rails/generators/templates/session/welcome.html.erb +2 -2
- data/lib/authpwn_rails/generators/templates/session_controller_test.rb +22 -0
- data/test/{session_controller_test.rb → session_controller_api_test.rb} +7 -1
- metadata +7 -6
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.4
|
data/authpwn_rails.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{authpwn_rails}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Victor Costan"]
|
12
|
-
s.date = %q{2010-08-
|
12
|
+
s.date = %q{2010-08-07}
|
13
13
|
s.description = %q{Works with Facebook.}
|
14
14
|
s.email = %q{victor@costan.us}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -39,6 +39,7 @@ Gem::Specification.new do |s|
|
|
39
39
|
"lib/authpwn_rails/generators/templates/session/new.html.erb",
|
40
40
|
"lib/authpwn_rails/generators/templates/session/welcome.html.erb",
|
41
41
|
"lib/authpwn_rails/generators/templates/session_controller.rb",
|
42
|
+
"lib/authpwn_rails/generators/templates/session_controller_test.rb",
|
42
43
|
"lib/authpwn_rails/generators/templates/user.rb",
|
43
44
|
"lib/authpwn_rails/generators/templates/users.yml",
|
44
45
|
"lib/authpwn_rails/generators/user_generator.rb",
|
@@ -52,7 +53,7 @@ Gem::Specification.new do |s|
|
|
52
53
|
"test/helpers/fbgraph.rb",
|
53
54
|
"test/helpers/routes.rb",
|
54
55
|
"test/helpers/view_helpers.rb",
|
55
|
-
"test/
|
56
|
+
"test/session_controller_api_test.rb",
|
56
57
|
"test/test_helper.rb",
|
57
58
|
"test/user_test.rb"
|
58
59
|
]
|
@@ -63,11 +64,11 @@ Gem::Specification.new do |s|
|
|
63
64
|
s.summary = %q{User authentication for Rails 3 applications.}
|
64
65
|
s.test_files = [
|
65
66
|
"test/facebook_token_test.rb",
|
67
|
+
"test/session_controller_api_test.rb",
|
66
68
|
"test/user_test.rb",
|
67
69
|
"test/cookie_controller_test.rb",
|
68
70
|
"test/test_helper.rb",
|
69
71
|
"test/facebook_controller_test.rb",
|
70
|
-
"test/session_controller_test.rb",
|
71
72
|
"test/helpers/application_controller.rb",
|
72
73
|
"test/helpers/routes.rb",
|
73
74
|
"test/helpers/fbgraph.rb",
|
@@ -14,6 +14,8 @@ class SessionGenerator < Rails::Generators::Base
|
|
14
14
|
File.join('app', 'views', 'session', 'new.html.erb')
|
15
15
|
copy_file File.join('session', 'welcome.html.erb'),
|
16
16
|
File.join('app', 'views', 'session', 'welcome.html.erb')
|
17
|
+
copy_file File.join('session_controller_test.rb'),
|
18
|
+
File.join('test', 'functional', 'session_controller_test.rb')
|
17
19
|
|
18
20
|
route "resource :session, :controller => 'session'"
|
19
21
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<p>
|
2
2
|
This view gets displayed when the user is not logged in. Entice the user to
|
3
|
-
sign up for your application, and
|
4
|
-
<%= link_to '
|
3
|
+
sign up for your application, and allow them to
|
4
|
+
<%= link_to 'Log in', new_session_path %>.
|
5
5
|
</p>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class SessionControllerTest < ActionController::TestCase
|
4
|
+
setup do
|
5
|
+
@user = users(:john)
|
6
|
+
end
|
7
|
+
|
8
|
+
test "user home page" do
|
9
|
+
set_session_current_user @user
|
10
|
+
get :show
|
11
|
+
|
12
|
+
assert_equal @user, assigns(:user)
|
13
|
+
assert_select 'a', 'Log out'
|
14
|
+
end
|
15
|
+
|
16
|
+
test "application welcome page" do
|
17
|
+
get :show
|
18
|
+
|
19
|
+
assert_equal User.count, assigns(:user_count)
|
20
|
+
assert_select 'a', 'Log in'
|
21
|
+
end
|
22
|
+
end
|
@@ -2,7 +2,13 @@ require File.expand_path('../test_helper', __FILE__)
|
|
2
2
|
|
3
3
|
require 'authpwn_rails/generators/templates/session_controller.rb'
|
4
4
|
|
5
|
-
|
5
|
+
# Run the tests in the generator, to make sure they pass.
|
6
|
+
require 'authpwn_rails/generators/templates/session_controller_test.rb'
|
7
|
+
|
8
|
+
# Tests the methods injected by authpwn_session_controller.
|
9
|
+
class SessionControllerApiTest < ActionController::TestCase
|
10
|
+
tests SessionController
|
11
|
+
|
6
12
|
setup do
|
7
13
|
@user = users(:john)
|
8
14
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authpwn_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 4
|
10
|
+
version: 0.4.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Victor Costan
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-07 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -99,6 +99,7 @@ files:
|
|
99
99
|
- lib/authpwn_rails/generators/templates/session/new.html.erb
|
100
100
|
- lib/authpwn_rails/generators/templates/session/welcome.html.erb
|
101
101
|
- lib/authpwn_rails/generators/templates/session_controller.rb
|
102
|
+
- lib/authpwn_rails/generators/templates/session_controller_test.rb
|
102
103
|
- lib/authpwn_rails/generators/templates/user.rb
|
103
104
|
- lib/authpwn_rails/generators/templates/users.yml
|
104
105
|
- lib/authpwn_rails/generators/user_generator.rb
|
@@ -112,7 +113,7 @@ files:
|
|
112
113
|
- test/helpers/fbgraph.rb
|
113
114
|
- test/helpers/routes.rb
|
114
115
|
- test/helpers/view_helpers.rb
|
115
|
-
- test/
|
116
|
+
- test/session_controller_api_test.rb
|
116
117
|
- test/test_helper.rb
|
117
118
|
- test/user_test.rb
|
118
119
|
has_rdoc: true
|
@@ -151,11 +152,11 @@ specification_version: 3
|
|
151
152
|
summary: User authentication for Rails 3 applications.
|
152
153
|
test_files:
|
153
154
|
- test/facebook_token_test.rb
|
155
|
+
- test/session_controller_api_test.rb
|
154
156
|
- test/user_test.rb
|
155
157
|
- test/cookie_controller_test.rb
|
156
158
|
- test/test_helper.rb
|
157
159
|
- test/facebook_controller_test.rb
|
158
|
-
- test/session_controller_test.rb
|
159
160
|
- test/helpers/application_controller.rb
|
160
161
|
- test/helpers/routes.rb
|
161
162
|
- test/helpers/fbgraph.rb
|