-
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.
Merge pull request #856 from NYPL/qa
Merging from qa to master
- Loading branch information
Showing
31 changed files
with
705 additions
and
31 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
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
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 |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
# Configure the e-mail address which will be shown in Devise::Mailer, | ||
# note that it will be overwritten if you use your own mailer class | ||
# with default "from" parameter. | ||
config.mailer_sender = '[email protected]' | ||
config.mailer_sender = '[email protected]' | ||
|
||
# Configure the class responsible to send e-mails. | ||
# config.mailer = 'Devise::Mailer' | ||
|
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 |
---|---|---|
|
@@ -5,3 +5,7 @@ | |
# below each fixture, per the syntax in the comments below | ||
# | ||
|
||
one: | ||
email: [email protected] | ||
two: | ||
email: [email protected] |
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,7 @@ | ||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html | ||
|
||
hold_changes1: | ||
hold_id: hold1.id | ||
admin_user_id: 1 | ||
status: new | ||
hold: hold1 |
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 @@ | ||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html | ||
|
||
subjects_one: | ||
title: "Authors Russiantest" | ||
|
||
subjects_two: | ||
title: "Social" |
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,31 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'test_helper' | ||
|
||
module Admin | ||
class AdminUsersControllerTest < ActionController::TestCase | ||
setup do | ||
@admin_user = admin_users(:one) | ||
sign_in AdminUser.create!(email: '[email protected]', password: 'password') | ||
end | ||
|
||
test "test index method" do | ||
response = get :index | ||
assert_equal("200", response.code) | ||
assert_response :success | ||
end | ||
|
||
test "test form method" do | ||
response = get :edit, id: @admin_user.id | ||
assert_equal("200", response.code) | ||
assert_response :success | ||
end | ||
|
||
test 'test enable_or_disable' do | ||
response = put :enable_or_disable, params: {id: @admin_user.id} | ||
assert_equal("E-mail notification change made!", flash[:notice]) | ||
assert_equal("302", response.code) | ||
assert_response :redirect | ||
end | ||
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,45 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'test_helper' | ||
module Admin | ||
class BooksControllerTest < ActionController::TestCase | ||
setup do | ||
@book = books(:books_two) | ||
sign_in AdminUser.create!(email: '[email protected]', password: 'password') | ||
end | ||
|
||
test "test index method" do | ||
get :index | ||
assert_equal("200", response.code) | ||
assert_response :success | ||
end | ||
|
||
test "test show method" do | ||
get :show, params: { id: @book.id } | ||
assert_equal("200", response.code) | ||
assert_response :success | ||
end | ||
|
||
test "test show method with version param" do | ||
create_book_version | ||
get :show, params: { id: @book.id, version: 1 } | ||
assert_equal("200", response.code) | ||
assert_response :success | ||
end | ||
|
||
test "test history method" do | ||
create_book_version | ||
get :history, params: { id: @book.id } | ||
assert_equal("200", response.code) | ||
assert_response :success | ||
end | ||
|
||
private | ||
|
||
def create_book_version | ||
book = Book.find(@book.id) | ||
book.details_url = 'details_url' | ||
book.save! | ||
end | ||
end | ||
end |
Oops, something went wrong.