contour 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,10 +3,10 @@
3
3
  valid:
4
4
  first_name: FirstName
5
5
  last_name: LastName
6
+ status: active
6
7
  deleted: false
7
- email: test@example.com
8
+ email: valid@example.com
8
9
  encrypted_password: MyString
9
- # password_salt: MyString
10
10
  reset_password_token: ResetTokenOne
11
11
  remember_token: MyString
12
12
  remember_created_at: MyDate
@@ -26,10 +26,10 @@ valid:
26
26
  invalid:
27
27
  first_name: MyString
28
28
  last_name: MyString
29
+ status: inactive
29
30
  deleted: false
30
31
  email: EmailTwo
31
32
  encrypted_password: MyString
32
- # password_salt: MyString
33
33
  reset_password_token: ResetTokenTwo
34
34
  remember_token: MyString
35
35
  remember_created_at: MyDate
@@ -49,10 +49,10 @@ invalid:
49
49
  deleted:
50
50
  first_name: Deleted
51
51
  last_name: User
52
+ status: active
52
53
  deleted: true
53
54
  email: deleted@example.com
54
55
  encrypted_password: MyString
55
- # password_salt: MyString
56
56
  reset_password_token: ResetTokenFive
57
57
  remember_token: MyString
58
58
  remember_created_at: 2011-02-23
@@ -67,4 +67,27 @@ deleted:
67
67
  # failed_attempts: 0
68
68
  # unlock_token: UnlockTokenFive
69
69
  # locked_at: 2011-02-23
70
+ # authentication_token: MyString
71
+
72
+ pending:
73
+ first_name: MyString
74
+ last_name: MyString
75
+ status: pending
76
+ deleted: false
77
+ email: pending@example.com
78
+ encrypted_password: MyString
79
+ reset_password_token: ResetTokenFour
80
+ remember_token: MyString
81
+ remember_created_at: 2011-02-23
82
+ sign_in_count: 0
83
+ current_sign_in_at: 2011-02-23
84
+ last_sign_in_at: 2011-02-23
85
+ current_sign_in_ip: MyString
86
+ last_sign_in_ip: MyString
87
+ # confirmation_token: ConfirmationTokenFour
88
+ # confirmed_at: 2011-02-23
89
+ # confirmation_sent_at: 2011-02-23
90
+ # failed_attempts: 0
91
+ # unlock_token: UnlockTokenFour
92
+ # locked_at: 2011-02-23
70
93
  # authentication_token: MyString
@@ -1,5 +1,7 @@
1
1
  require 'test_helper'
2
2
 
3
+ SimpleCov.command_name "test:functionals"
4
+
3
5
  class Contour::AuthenticationsControllerTest < ActionController::TestCase
4
6
  setup do
5
7
  login(users(:valid))
@@ -1,8 +1,46 @@
1
1
  require 'test_helper'
2
2
 
3
+ SimpleCov.command_name "test:integration"
4
+
3
5
  class NavigationTest < ActionDispatch::IntegrationTest
4
- # Replace this with your real tests.
5
- test "the truth" do
6
- assert true
6
+ fixtures :users
7
+
8
+ def setup
9
+ @valid = users(:valid)
10
+ @pending = users(:pending)
11
+ @deleted = users(:deleted)
12
+ end
13
+
14
+ test "pending users should be not be allowed to login" do
15
+ get "/logged_in_page"
16
+ assert_redirected_to new_user_session_path
17
+
18
+ sign_in_as(@pending, "123456", "pending-2@example.com")
19
+ assert_equal new_user_session_path, path
20
+ assert_equal I18n.t('devise.failure.inactive'), flash[:alert]
21
+ end
22
+
23
+ test "deleted users should be not be allowed to login" do
24
+ get "/logged_in_page"
25
+ assert_redirected_to new_user_session_path
26
+
27
+ sign_in_as(@deleted, "123456", "deleted-2@example.com")
28
+ assert_equal new_user_session_path, path
29
+ assert_equal I18n.t('devise.failure.inactive'), flash[:alert]
30
+ end
31
+
32
+ test "root navigation redirected to login page" do
33
+ get "/"
34
+ assert_redirected_to new_user_session_path
35
+ assert_equal I18n.t('devise.failure.unauthenticated'), flash[:alert]
36
+ end
37
+
38
+ test "friendly url forwarding after login" do
39
+ get "/logged_in_page"
40
+ assert_redirected_to new_user_session_path
41
+
42
+ sign_in_as(@valid, "123456", "valid-2@example.com")
43
+ assert_equal '/logged_in_page', path
44
+ assert_equal I18n.t('devise.sessions.signed_in'), flash[:notice]
7
45
  end
8
46
  end
@@ -1,3 +1,5 @@
1
+ require 'simplecov'
2
+
1
3
  # Configure Rails Environment
2
4
  ENV["RAILS_ENV"] = "test"
3
5
 
@@ -9,38 +11,37 @@ Rails.backtrace_cleaner.remove_silencers!
9
11
  # Load support files
10
12
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
13
 
12
- # class ActiveSupport::TestCase
13
- # # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
14
- # #
15
- # # Note: You'll currently still have to declare fixtures explicitly in integration tests
16
- # # -- they do not yet inherit this setting
17
- # fixtures :all
18
- #
19
- # # Add more helper methods to be used by all tests here...
20
- # end
21
- #
22
- # class ActionController::TestCase
23
- # include Devise::TestHelpers
24
- #
25
- # def login(user)
26
- # @request.env["devise.mapping"] = Devise.mappings[user]
27
- # sign_in(:user, user)
28
- # end
29
- # end
30
- #
31
- # class ActionController::IntegrationTest
32
- # def sign_in_as(user_template, password, email)
33
- # user = User.create(:password => password, :password_confirmation => password, :email => email,
34
- # :first_name => user_template.first_name, :last_name => user_template.last_name)
35
- # user.save!
36
- # # user.update_attribute :status, user_template.status
37
- # user.update_attribute :deleted, user_template.deleted?
38
- # # user.update_attribute :system_admin, user_template.system_admin?
39
- # post_via_redirect 'users/login', :user => {:email => email, :password => password}
40
- # user
41
- # end
42
- # end
43
- #
14
+ class ActiveSupport::TestCase
15
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
16
+ #
17
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
18
+ # -- they do not yet inherit this setting
19
+ fixtures :all
20
+
21
+ # Add more helper methods to be used by all tests here...
22
+ end
23
+
24
+ class ActionController::TestCase
25
+ include Devise::TestHelpers
26
+
27
+ def login(user)
28
+ @request.env["devise.mapping"] = Devise.mappings[user]
29
+ sign_in(:user, user)
30
+ end
31
+ end
32
+
33
+ class ActionController::IntegrationTest
34
+ def sign_in_as(user_template, password, email)
35
+ user = User.create( password: password, password_confirmation: password, email: email,
36
+ first_name: user_template.first_name, last_name: user_template.last_name )
37
+ user.save!
38
+ user.update_attribute :status, user_template.status
39
+ user.update_attribute :deleted, user_template.deleted?
40
+ post_via_redirect 'users/login', user: { email: email, password: password }
41
+ user
42
+ end
43
+ end
44
+
44
45
  # module Rack
45
46
  # module Test
46
47
  # class UploadedFile
@@ -49,4 +50,4 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
49
50
  # end
50
51
  # end
51
52
  # end
52
- # end
53
+ # _end_
@@ -1,12 +1,12 @@
1
1
  require 'test_helper'
2
2
 
3
- # SimpleCov.command_name "test:units"
3
+ SimpleCov.command_name "test:units"
4
4
 
5
5
  class UserTest < ActiveSupport::TestCase
6
6
  test "should get reverse name" do
7
7
  assert_equal 'LastName, FirstName', users(:valid).reverse_name
8
8
  end
9
-
9
+
10
10
  test "should apply omniauth" do
11
11
  assert_not_nil users(:valid).apply_omniauth({'user_info' => {'email' => 'Email', 'first_name' => 'FirstName', 'last_name' => 'LastName'}})
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contour
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-09 00:00:00.000000000 Z
12
+ date: 2012-01-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70148576857840 !ruby/object:Gem::Requirement
16
+ requirement: &70150284044040 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.2.0.rc2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70148576857840
24
+ version_requirements: *70150284044040
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: devise
27
- requirement: &70148576856280 !ruby/object:Gem::Requirement
27
+ requirement: &70150284043220 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.4.9
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70148576856280
35
+ version_requirements: *70150284043220
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: omniauth
38
- requirement: &70148576871480 !ruby/object:Gem::Requirement
38
+ requirement: &70150284042180 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - =
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.2.6
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70148576871480
46
+ version_requirements: *70150284042180
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: jquery-rails
49
- requirement: &70148576868800 !ruby/object:Gem::Requirement
49
+ requirement: &70150284041220 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: 2.0.0
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70148576868800
57
+ version_requirements: *70150284041220
58
58
  description: Basic Rails Framework files and assets for layout and authentication
59
59
  email: remosm@gmail.com
60
60
  executables: []
@@ -1030,9 +1030,12 @@ files:
1030
1030
  - test/dummy/app/assets/javascripts/application.js
1031
1031
  - test/dummy/app/assets/stylesheets/application.css
1032
1032
  - test/dummy/app/controllers/application_controller.rb
1033
+ - test/dummy/app/controllers/welcome_controller.rb
1033
1034
  - test/dummy/app/helpers/application_helper.rb
1035
+ - test/dummy/app/helpers/welcome_helper.rb
1034
1036
  - test/dummy/app/models/user.rb
1035
1037
  - test/dummy/app/views/layouts/application.html.erb
1038
+ - test/dummy/app/views/welcome/index.html.erb
1036
1039
  - test/dummy/config/application.rb
1037
1040
  - test/dummy/config/boot.rb
1038
1041
  - test/dummy/config/database.yml
@@ -1054,14 +1057,17 @@ files:
1054
1057
  - test/dummy/db/migrate/20111203203123_create_users.rb
1055
1058
  - test/dummy/db/migrate/20111203203307_create_authentications.rb
1056
1059
  - test/dummy/db/schema.rb
1060
+ - test/dummy/db/test.sqlite3
1061
+ - test/dummy/log/development.log
1062
+ - test/dummy/log/test.log
1057
1063
  - test/dummy/public/404.html
1058
1064
  - test/dummy/public/422.html
1059
1065
  - test/dummy/public/500.html
1060
1066
  - test/dummy/public/favicon.ico
1061
1067
  - test/dummy/Rakefile
1062
1068
  - test/dummy/script/rails
1063
- - test/fixtures/authentications.yml
1064
- - test/fixtures/users.yml
1069
+ - test/dummy/test/fixtures/authentications.yml
1070
+ - test/dummy/test/fixtures/users.yml
1065
1071
  - test/functional/authentications_controller_test.rb
1066
1072
  - test/functional/registrations_controller_test.rb
1067
1073
  - test/integration/navigation_test.rb
@@ -1097,9 +1103,12 @@ test_files:
1097
1103
  - test/dummy/app/assets/javascripts/application.js
1098
1104
  - test/dummy/app/assets/stylesheets/application.css
1099
1105
  - test/dummy/app/controllers/application_controller.rb
1106
+ - test/dummy/app/controllers/welcome_controller.rb
1100
1107
  - test/dummy/app/helpers/application_helper.rb
1108
+ - test/dummy/app/helpers/welcome_helper.rb
1101
1109
  - test/dummy/app/models/user.rb
1102
1110
  - test/dummy/app/views/layouts/application.html.erb
1111
+ - test/dummy/app/views/welcome/index.html.erb
1103
1112
  - test/dummy/config/application.rb
1104
1113
  - test/dummy/config/boot.rb
1105
1114
  - test/dummy/config/database.yml
@@ -1121,14 +1130,17 @@ test_files:
1121
1130
  - test/dummy/db/migrate/20111203203123_create_users.rb
1122
1131
  - test/dummy/db/migrate/20111203203307_create_authentications.rb
1123
1132
  - test/dummy/db/schema.rb
1133
+ - test/dummy/db/test.sqlite3
1134
+ - test/dummy/log/development.log
1135
+ - test/dummy/log/test.log
1124
1136
  - test/dummy/public/404.html
1125
1137
  - test/dummy/public/422.html
1126
1138
  - test/dummy/public/500.html
1127
1139
  - test/dummy/public/favicon.ico
1128
1140
  - test/dummy/Rakefile
1129
1141
  - test/dummy/script/rails
1130
- - test/fixtures/authentications.yml
1131
- - test/fixtures/users.yml
1142
+ - test/dummy/test/fixtures/authentications.yml
1143
+ - test/dummy/test/fixtures/users.yml
1132
1144
  - test/functional/authentications_controller_test.rb
1133
1145
  - test/functional/registrations_controller_test.rb
1134
1146
  - test/integration/navigation_test.rb