-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ff74df
commit bba795a
Showing
17 changed files
with
109 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module UsersHelper | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
= simple_form_for(@user) do |f| | ||
= f.error_notification | ||
|
||
.form-inputs | ||
|
||
.form-actions | ||
= f.button :submit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%h1 Editing user | ||
|
||
= render 'form' | ||
|
||
= link_to 'Show', @user | ||
\| | ||
= link_to 'Back', users_path |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
json.array!(@users) do |user| | ||
json.extract! user, | ||
json.url user_url(user, format: :json) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%h1 New user | ||
|
||
= render 'form' | ||
|
||
= link_to 'Back', users_path |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
%p#notice= notice | ||
|
||
|
||
= link_to 'Edit', edit_user_path(@user) | ||
\| | ||
= link_to 'Back', users_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
json.extract! @user, :created_at, :updated_at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
require 'test_helper' | ||
|
||
class UsersControllerTest < ActionController::TestCase | ||
setup do | ||
@user = users(:one) | ||
end | ||
|
||
test "should get index" do | ||
get :index | ||
assert_response :success | ||
assert_not_nil assigns(:users) | ||
end | ||
|
||
test "should get new" do | ||
get :new | ||
assert_response :success | ||
end | ||
|
||
test "should create user" do | ||
assert_difference('User.count') do | ||
post :create, user: { } | ||
end | ||
|
||
assert_redirected_to user_path(assigns(:user)) | ||
end | ||
|
||
test "should show user" do | ||
get :show, id: @user | ||
assert_response :success | ||
end | ||
|
||
test "should get edit" do | ||
get :edit, id: @user | ||
assert_response :success | ||
end | ||
|
||
test "should update user" do | ||
patch :update, id: @user, user: { } | ||
assert_redirected_to user_path(assigns(:user)) | ||
end | ||
|
||
test "should destroy user" do | ||
assert_difference('User.count', -1) do | ||
delete :destroy, id: @user | ||
end | ||
|
||
assert_redirected_to users_path | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require 'test_helper' | ||
|
||
class UsersHelperTest < ActionView::TestCase | ||
end |