contour 2.7.0 → 3.0.0.beta1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +1 -29
- data/app/assets/stylesheets/glyphicon-overrides.scss +13 -0
- data/app/assets/stylesheets/opensans.scss +20 -0
- data/app/controllers/contour/registrations_controller.rb +1 -10
- data/app/controllers/contour/sessions_controller.rb +8 -41
- data/app/views/contour/layouts/_menu.html.erb +0 -2
- data/app/views/contour/sessions/new.html.erb +32 -46
- data/config/routes.rb +0 -5
- data/contour.gemspec +0 -3
- data/lib/contour.rb +2 -14
- data/lib/contour/fixes.rb +0 -3
- data/lib/contour/version.rb +3 -3
- data/lib/generators/contour/install/install_generator.rb +0 -4
- data/lib/generators/contour/install/templates/README +0 -4
- data/lib/generators/contour/install/templates/contour.rb +2 -12
- data/test/controllers/passwords_controller_test.rb +0 -9
- data/test/controllers/registrations_controller_test.rb +0 -14
- data/test/controllers/sessions_controller_test.rb +0 -12
- data/test/dummy/app/models/user.rb +0 -3
- data/test/dummy/config/initializers/contour.rb +2 -12
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20111203203123_devise_create_users.rb +1 -1
- data/test/dummy/db/schema.rb +4 -12
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/test/fixtures/users.yml +1 -1
- data/test/models/user_test.rb +0 -4
- metadata +5 -71
- data/app/assets/stylesheets/glyphicon-overrides.scss.erb +0 -13
- data/app/assets/stylesheets/opensans.css.erb +0 -20
- data/app/controllers/contour/authentications_controller.rb +0 -57
- data/app/models/authentication.rb +0 -4
- data/app/models/concerns/contour_authenticatable.rb +0 -12
- data/app/models/concerns/contourable.rb +0 -19
- data/app/views/contour/authentications/_add_remove_table.html.erb +0 -31
- data/app/views/contour/authentications/_authentications.html.erb +0 -3
- data/app/views/contour/authentications/_menu.html.erb +0 -10
- data/app/views/contour/authentications/destroy.js.erb +0 -1
- data/app/views/contour/authentications/index.html.erb +0 -6
- data/app/views/contour/layouts/_latest_news.html.erb +0 -17
- data/lib/contour/fixes/devise-with-rails-4-2.rb +0 -17
- data/lib/contour/fixes/omniauth.rb +0 -110
- data/lib/contour/fixes/sass-rails.rb +0 -8
- data/lib/generators/contour/install/templates/omniauth.rb +0 -33
- data/test/controllers/authentications_controller_test.rb +0 -57
- data/test/dummy/config/initializers/omniauth.rb +0 -33
- data/test/dummy/db/migrate/20111203203307_create_authentications.rb +0 -11
- data/test/dummy/test/fixtures/authentications.yml +0 -16
- data/test/models/authentication_test.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2e373a1e2322fc9859477f26f26998728a74ef0
|
4
|
+
data.tar.gz: 010c2ddc245cd936603f9a7ddcdcff18ca8600a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51cd53eafaea08f98cc1a15ff0b5c948a5c164509735480e17bb0a134398597caae871fd6306f3e5fe4e6217b2dce33918f1ba67f5cde4fa59c42c0a5bd42681
|
7
|
+
data.tar.gz: 8a55bf71285748a8d1c0024906a2197f7231daa69bb58b059709804b6855f3e7874bd31de0c0d9c7dc026c6c16dd34daad1c82a564562d25c7b56db4b001be58
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## 3.0.0
|
2
|
+
|
3
|
+
### Breaking Changes
|
4
|
+
- Removed multiple authentication support as this is better handled directly with omniauth and devise
|
5
|
+
- Removed news feed stream from new registration page
|
6
|
+
|
7
|
+
### Enhancements
|
8
|
+
- Simplified SCSS files using `asset-url`
|
9
|
+
- **Gem Changes**
|
10
|
+
- Removed omniauth, omniauth-ldap, and omniauth-openid
|
11
|
+
|
1
12
|
## 2.7.0 (February 13, 2015)
|
2
13
|
|
3
14
|
### Enhancements
|
data/README.md
CHANGED
@@ -35,7 +35,7 @@ cd blank_rails_project
|
|
35
35
|
Modify `Gemfile` and add
|
36
36
|
|
37
37
|
```ruby
|
38
|
-
gem 'contour', '~>
|
38
|
+
gem 'contour', '~> 3.0.0'
|
39
39
|
```
|
40
40
|
|
41
41
|
Run Bundle install
|
@@ -50,20 +50,6 @@ Install contour files
|
|
50
50
|
rails generate contour:install
|
51
51
|
```
|
52
52
|
|
53
|
-
Add the authentication model
|
54
|
-
|
55
|
-
```
|
56
|
-
rails generate model Authentication user_id:integer provider:string uid:string
|
57
|
-
```
|
58
|
-
|
59
|
-
Migrate your database
|
60
|
-
|
61
|
-
```
|
62
|
-
bundle exec rake db:create
|
63
|
-
|
64
|
-
bundle exec rake db:migrate
|
65
|
-
```
|
66
|
-
|
67
53
|
Create a sample controller
|
68
54
|
|
69
55
|
```
|
@@ -119,20 +105,6 @@ Add the following to the top of your `app/controllers/welcome_controller.rb`
|
|
119
105
|
before_action :authenticate_user!
|
120
106
|
```
|
121
107
|
|
122
|
-
Add the following to your `app/models/user.rb`
|
123
|
-
|
124
|
-
```ruby
|
125
|
-
# Concerns
|
126
|
-
include Contourable
|
127
|
-
```
|
128
|
-
|
129
|
-
Add the following to your `app/models/authentication.rb`
|
130
|
-
|
131
|
-
```ruby
|
132
|
-
# Concerns
|
133
|
-
include ContourAuthenticatable
|
134
|
-
```
|
135
|
-
|
136
108
|
Edit `config/initializers/devise.rb` to use `:get` for devise `sign_out_via`
|
137
109
|
|
138
110
|
```ruby
|
@@ -0,0 +1,13 @@
|
|
1
|
+
@font-face {
|
2
|
+
font-family: 'Glyphicons Halflings Contour';
|
3
|
+
src: asset-url('bootstrap/glyphicons-halflings-regular.eot');
|
4
|
+
|
5
|
+
src: asset-url('bootstrap/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
|
6
|
+
asset-url('bootstrap/glyphicons-halflings-regular.woff') format('woff'),
|
7
|
+
asset-url('bootstrap/glyphicons-halflings-regular.ttf') format('truetype'),
|
8
|
+
asset-url('bootstrap/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
|
9
|
+
}
|
10
|
+
|
11
|
+
.glyphicon {
|
12
|
+
font-family: 'Glyphicons Halflings Contour';
|
13
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
@font-face {
|
2
|
+
font-family: 'Open Sans';
|
3
|
+
font-style: normal;
|
4
|
+
font-weight: 300;
|
5
|
+
src: asset-url('opensans/OpenSans-Light.ttf') format('truetype');
|
6
|
+
}
|
7
|
+
|
8
|
+
@font-face {
|
9
|
+
font-family: 'Open Sans';
|
10
|
+
font-style: normal;
|
11
|
+
font-weight: 400;
|
12
|
+
src: asset-url('opensans/OpenSans-Regular.ttf') format('truetype');
|
13
|
+
}
|
14
|
+
|
15
|
+
@font-face {
|
16
|
+
font-family: 'Open Sans';
|
17
|
+
font-style: normal;
|
18
|
+
font-weight: 700;
|
19
|
+
src: asset-url('opensans/OpenSans-Bold.ttf') format('truetype');
|
20
|
+
}
|
@@ -27,7 +27,7 @@ class Contour::RegistrationsController < Devise::RegistrationsController
|
|
27
27
|
redirect_to new_session_path(resource), notice: 'Thank you for your interest! Due to limited capacity you have been put on a waiting list. We will email you when we open up additional space.'
|
28
28
|
else
|
29
29
|
super
|
30
|
-
session[:omniauth] = nil if @user and not @user.new_record?
|
30
|
+
# session[:omniauth] = nil if @user and not @user.new_record?
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -38,15 +38,6 @@ class Contour::RegistrationsController < Devise::RegistrationsController
|
|
38
38
|
devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(*permitted_fields) }
|
39
39
|
end
|
40
40
|
|
41
|
-
def build_resource(hash=nil)
|
42
|
-
object = super(hash)
|
43
|
-
if session[:omniauth]
|
44
|
-
@user.apply_omniauth(session[:omniauth])
|
45
|
-
@user.valid?
|
46
|
-
end
|
47
|
-
object
|
48
|
-
end
|
49
|
-
|
50
41
|
def after_inactive_sign_up_path_for(resource)
|
51
42
|
new_session_path(resource) # root_path
|
52
43
|
end
|
@@ -1,47 +1,14 @@
|
|
1
|
-
require 'rss/2.0'
|
2
|
-
require 'open-uri'
|
3
|
-
|
4
1
|
class Contour::SessionsController < Devise::SessionsController
|
5
2
|
|
6
|
-
|
7
|
-
@news_feed = ''
|
8
|
-
unless Contour.news_feed.blank?
|
9
|
-
begin
|
10
|
-
open(Contour.news_feed, ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE) do |http|
|
11
|
-
response = http.read
|
12
|
-
@news_feed = RSS::Parser.parse(response, false)
|
13
|
-
end
|
14
|
-
rescue => e
|
15
|
-
logger.info "\n\nRSS Feed #{Contour.news_feed}\nRSS Feed Error: #{e}\n\n"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
super
|
20
|
-
end
|
21
|
-
|
22
|
-
# Overwrite Devise authentication to check if the user is typing another credential into the default box
|
23
|
-
# if so, find alternative login methods for that user and forward the user to those login screens
|
3
|
+
# Overwrite devise to provide JSON responses as well
|
24
4
|
def create
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
if
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
respond_to do |format|
|
33
|
-
format.html { respond_with resource, location: after_sign_in_path_for(resource) }
|
34
|
-
format.json { render json: { success: true, resource_name => { id: resource.id, email: resource.email, first_name: resource.first_name, last_name: resource.last_name, authentication_token: (resource.respond_to?(:authentication_token) ? resource.authentication_token : nil) } } }
|
35
|
-
end
|
36
|
-
else
|
37
|
-
resource = resource_name.to_s.titleize.constantize.find_by_email(params[resource_name][:email])
|
38
|
-
if resource and resource.respond_to?('authentications') and providers = resource.authentications.pluck(:provider).uniq and providers.size > 0
|
39
|
-
redirect_to request.script_name + '/auth/' + providers.first
|
40
|
-
elsif providers = Authentication.where(uid: params[resource_name][:email]).pluck(:provider).uniq and providers.size > 0
|
41
|
-
redirect_to request.script_name + '/auth/' + providers.first
|
42
|
-
else
|
43
|
-
resource = warden.authenticate!(auth_options)
|
44
|
-
end
|
5
|
+
self.resource = warden.authenticate!(auth_options)
|
6
|
+
set_flash_message(:notice, :signed_in) if is_flashing_format?
|
7
|
+
sign_in(resource_name, resource)
|
8
|
+
yield resource if block_given?
|
9
|
+
respond_to do |format|
|
10
|
+
format.html { respond_with resource, location: after_sign_in_path_for(resource) }
|
11
|
+
format.json { render json: { success: true, resource_name => { id: resource.id, email: resource.email, first_name: resource.first_name, last_name: resource.last_name, authentication_token: (resource.respond_to?(:authentication_token) ? resource.authentication_token : nil) } } }
|
45
12
|
end
|
46
13
|
end
|
47
14
|
|
@@ -32,8 +32,6 @@
|
|
32
32
|
<li class="divider"></li>
|
33
33
|
<% elsif not link[:header].blank? %>
|
34
34
|
<li class="dropdown-header"><%= link[:eval] ? eval(link[:header]) : link[:header] %></li>
|
35
|
-
<% elsif link[:authentications] == true %>
|
36
|
-
<%= render partial: 'contour/authentications/menu' %>
|
37
35
|
<% else %>
|
38
36
|
<li><%= link_to (link[:eval] ? eval(link[:html].blank? ? link[:name] : link[:html].html_safe) : (link[:html].blank? ? link[:name] : link[:html].html_safe) + (link[:image].blank? ? '' : image_tag(link[:image], link[:image_options]))).html_safe, link[:path].blank? ? '#' : eval(link[:path].to_s), target: link[:target] %></li>
|
39
37
|
<% end %>
|
@@ -1,55 +1,41 @@
|
|
1
1
|
<% @title = 'Sign in' %>
|
2
2
|
|
3
|
-
<div class="
|
4
|
-
<
|
5
|
-
|
6
|
-
<h1><%= @title %></h1>
|
7
|
-
</div>
|
8
|
-
|
9
|
-
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), html: { class: 'form-horizontal' }) do |f| %>
|
10
|
-
<div class="form-group">
|
11
|
-
<%= f.label :email, class: 'col-md-2 control-label' %>
|
12
|
-
<div class="col-md-10">
|
13
|
-
<%= f.email_field :email, class: 'form-control' %>
|
14
|
-
</div>
|
15
|
-
</div>
|
3
|
+
<div class="page-header">
|
4
|
+
<h1><%= @title %></h1>
|
5
|
+
</div>
|
16
6
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
7
|
+
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), html: { class: 'form-horizontal' }) do |f| %>
|
8
|
+
<div class="form-group">
|
9
|
+
<%= f.label :email, class: 'col-md-2 control-label' %>
|
10
|
+
<div class="col-md-10">
|
11
|
+
<%= f.email_field :email, class: 'form-control' %>
|
12
|
+
</div>
|
13
|
+
</div>
|
23
14
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
Remember me
|
31
|
-
</label>
|
32
|
-
</div>
|
33
|
-
</div>
|
34
|
-
</div>
|
35
|
-
<% end -%>
|
15
|
+
<div class="form-group">
|
16
|
+
<%= f.label :password, class: 'col-md-2 control-label' %>
|
17
|
+
<div class="col-md-10">
|
18
|
+
<%= f.password_field :password, class: 'form-control' %>
|
19
|
+
</div>
|
20
|
+
</div>
|
36
21
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
<% end %>
|
22
|
+
<% if devise_mapping.rememberable? -%>
|
23
|
+
<div class="form-group">
|
24
|
+
<div class="col-md-offset-2 col-md-10">
|
25
|
+
<div class="checkbox">
|
26
|
+
<label>
|
27
|
+
<%= f.check_box :remember_me %>
|
28
|
+
Remember me
|
29
|
+
</label>
|
46
30
|
</div>
|
47
31
|
</div>
|
48
|
-
|
49
|
-
|
50
|
-
</div>
|
32
|
+
</div>
|
33
|
+
<% end -%>
|
51
34
|
|
52
|
-
<div class="
|
53
|
-
|
35
|
+
<div class="form-group">
|
36
|
+
<div class="col-md-offset-2 col-md-10">
|
37
|
+
<%= f.submit "Sign in", class: 'btn btn-primary' %>
|
38
|
+
<%= render partial: 'contour/links' %>
|
39
|
+
</div>
|
54
40
|
</div>
|
55
|
-
|
41
|
+
<% end %>
|
data/config/routes.rb
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
Rails.application.routes.draw do
|
2
2
|
|
3
|
-
get '/auth/failure' => 'contour/authentications#failure'
|
4
|
-
post '/auth/:provider/callback' => 'contour/authentications#create'
|
5
|
-
get '/auth/:provider' => 'contour/authentications#passthru'
|
6
3
|
get '/contour' => 'contour/samples#index'
|
7
4
|
|
8
|
-
resources :authentications, controller: 'contour/authentications'
|
9
|
-
|
10
5
|
# devise_for :users, controllers: { registrations: 'contour/registrations',
|
11
6
|
# sessions: 'contour/sessions',
|
12
7
|
# passwords: 'contour/passwords',
|
data/contour.gemspec
CHANGED
@@ -28,9 +28,6 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_dependency 'jquery-rails', '>= 3.0.4'
|
29
29
|
s.add_dependency 'coffee-rails', '~> 4.1.0'
|
30
30
|
s.add_dependency 'devise', '~> 3.4.1'
|
31
|
-
s.add_dependency 'omniauth', '~> 1.2.1'
|
32
|
-
s.add_dependency 'omniauth-ldap', '~> 1.0.4'
|
33
|
-
s.add_dependency 'omniauth-openid', '~> 1.0.1'
|
34
31
|
s.add_dependency 'bootstrap-sass', '~> 3.3.3'
|
35
32
|
s.add_dependency 'sass-rails', '~> 5.0.1'
|
36
33
|
s.add_dependency 'autoprefixer-rails'
|
data/lib/contour.rb
CHANGED
@@ -31,15 +31,11 @@ module Contour
|
|
31
31
|
@@menu_items = [
|
32
32
|
{
|
33
33
|
name: 'Login', display: 'not_signed_in', path: 'new_user_session_path', position: 'right', condition: 'true',
|
34
|
-
links: [{ name: 'Sign Up', path: 'new_user_registration_path' }
|
35
|
-
{ divider: true },
|
36
|
-
{ authentications: true }]
|
34
|
+
links: [{ name: 'Sign Up', path: 'new_user_registration_path' }]
|
37
35
|
},
|
38
36
|
{
|
39
37
|
name: 'current_user.email', eval: true, display: 'signed_in', position: 'right', condition: 'true',
|
40
|
-
links: [{ name: '
|
41
|
-
{ divider: true },
|
42
|
-
{ name: 'Logout', path: 'destroy_user_session_path' }]
|
38
|
+
links: [{ name: 'Logout', path: 'destroy_user_session_path' }]
|
43
39
|
},
|
44
40
|
{
|
45
41
|
name: 'Home', display: 'always', path: 'root_path', position: 'left', condition: 'true', image: '', image_options: {},
|
@@ -57,14 +53,6 @@ module Contour
|
|
57
53
|
mattr_accessor :search_bar
|
58
54
|
@@search_bar = {}
|
59
55
|
|
60
|
-
# Default news feed
|
61
|
-
mattr_accessor :news_feed
|
62
|
-
@@news_feed = nil
|
63
|
-
|
64
|
-
# Default max number of items displayed in the news feed
|
65
|
-
mattr_accessor :news_feed_items
|
66
|
-
@@news_feed_items = 5
|
67
|
-
|
68
56
|
# A string or array of strings that represent a CSS color code for generic link color
|
69
57
|
mattr_accessor :link_color
|
70
58
|
@@link_color = nil
|
data/lib/contour/fixes.rb
CHANGED
data/lib/contour/version.rb
CHANGED
@@ -8,10 +8,6 @@ class Contour::InstallGenerator < Rails::Generators::Base
|
|
8
8
|
template "contour.rb", "config/initializers/contour.rb"
|
9
9
|
end
|
10
10
|
|
11
|
-
def copy_omniauth
|
12
|
-
template "omniauth.rb", "config/initializers/omniauth.rb"
|
13
|
-
end
|
14
|
-
|
15
11
|
def install_devise
|
16
12
|
generate("devise:install")
|
17
13
|
model_name = ask("What would you like the user model to be called? [user]")
|
@@ -17,8 +17,4 @@ Contour requires some additional setup:
|
|
17
17
|
|
18
18
|
4. Remove any scaffold.css files that exist in your application
|
19
19
|
|
20
|
-
5. Make a migration for Authentications
|
21
|
-
|
22
|
-
rails generate model Authentication user_id:integer provider:string uid:string
|
23
|
-
|
24
20
|
===============================================================================
|
@@ -21,15 +21,11 @@ Contour.setup do |config|
|
|
21
21
|
# [
|
22
22
|
# {
|
23
23
|
# name: 'Login', display: 'not_signed_in', path: 'new_user_session_path', position: 'right', condition: 'true',
|
24
|
-
# links: [{ name: 'Sign Up', path: 'new_user_registration_path' }
|
25
|
-
# { divider: true },
|
26
|
-
# { authentications: true }]
|
24
|
+
# links: [{ name: 'Sign Up', path: 'new_user_registration_path' }]
|
27
25
|
# },
|
28
26
|
# {
|
29
27
|
# name: 'current_user.email', eval: true, display: 'signed_in', position: 'right', condition: 'true',
|
30
|
-
# links: [{ name: '
|
31
|
-
# { divider: true },
|
32
|
-
# { name: 'Logout', path: 'destroy_user_session_path' }]
|
28
|
+
# links: [{ name: 'Logout', path: 'destroy_user_session_path' }]
|
33
29
|
# },
|
34
30
|
# {
|
35
31
|
# name: 'Home', display: 'always', path: 'root_path', position: 'left', condition: 'true', image: '', image_options: {},
|
@@ -46,12 +42,6 @@ Contour.setup do |config|
|
|
46
42
|
# position: 'left'
|
47
43
|
# }
|
48
44
|
|
49
|
-
# Enter an address of a valid RSS Feed if you would like to see news on the sign in page.
|
50
|
-
# config.news_feed = ''
|
51
|
-
|
52
|
-
# Enter the max number of items you want to see in the news feed.
|
53
|
-
# config.news_feed_items = 5
|
54
|
-
|
55
45
|
# The following three parameters can be set as strings, which will rotate through the colors on a daily basis, selecting an index using (YearDay % ArraySize)
|
56
46
|
|
57
47
|
# A string or array of strings that represent a CSS color code for generic link color
|
@@ -16,13 +16,4 @@ class Contour::PasswordsControllerTest < ActionController::TestCase
|
|
16
16
|
assert_equal I18n.t('devise.passwords.send_instructions'), flash[:notice]
|
17
17
|
assert_redirected_to new_user_session_path
|
18
18
|
end
|
19
|
-
|
20
|
-
# test "an admin should be able to create new user" do
|
21
|
-
# assert_difference('User.count') do
|
22
|
-
# post :create, user: { first_name: 'First Name', last_name: 'Last Name', status: 'active', email: 'new_registration@example.com',
|
23
|
-
# steering_committee: true, steering_committee_secretary: false, pp_committee: false, pp_committee_secretary: false, system_admin: false }
|
24
|
-
# end
|
25
|
-
#
|
26
|
-
# assert_redirected_to user_path(assigns(:user))
|
27
|
-
# end
|
28
19
|
end
|
@@ -64,18 +64,4 @@ class Contour::RegistrationsControllerTest < ActionController::TestCase
|
|
64
64
|
# assert_response :success
|
65
65
|
# end
|
66
66
|
|
67
|
-
# test "an admin should be able to create new user" do
|
68
|
-
# login(users(:admin))
|
69
|
-
# assert_difference('User.count') do
|
70
|
-
# post :create, user: { first_name: 'First Name', last_name: 'Last Name', status: 'active', email: 'new_registration@example.com', system_admin: false }
|
71
|
-
# end
|
72
|
-
|
73
|
-
# assert_not_nil assigns(:user)
|
74
|
-
# assert_equal 'First Name', assigns(:user).first_name
|
75
|
-
# assert_equal 'Last Name', assigns(:user).last_name
|
76
|
-
# assert_equal 'active', assigns(:user).status
|
77
|
-
# assert_equal 'new_registration@example.com', assigns(:user).email
|
78
|
-
|
79
|
-
# assert_redirected_to user_path(assigns(:user))
|
80
|
-
# end
|
81
67
|
end
|