@@ -476,19 +476,19 class UserTest < ActiveSupport::TestCase | |||||
476 | assert_equal ['users.lastname', 'users.firstname', 'users.id'], User.fields_for_order_statement |
|
476 | assert_equal ['users.lastname', 'users.firstname', 'users.id'], User.fields_for_order_statement | |
477 | end |
|
477 | end | |
478 | end |
|
478 | end | |
479 |
|
479 | |||
480 | def test_fields_for_order_statement_width_table_name_should_prepend_table_name |
|
480 | def test_fields_for_order_statement_width_table_name_should_prepend_table_name | |
481 | with_settings :user_format => 'lastname_firstname' do |
|
481 | with_settings :user_format => 'lastname_firstname' do | |
482 | assert_equal ['authors.lastname', 'authors.firstname', 'authors.id'], User.fields_for_order_statement('authors') |
|
482 | assert_equal ['authors.lastname', 'authors.firstname', 'authors.id'], User.fields_for_order_statement('authors') | |
483 | end |
|
483 | end | |
484 | end |
|
484 | end | |
485 |
|
485 | |||
486 | def test_fields_for_order_statement_with_blank_format_should_return_default |
|
486 | def test_fields_for_order_statement_with_blank_format_should_return_default | |
487 | with_settings :user_format => '' do |
|
487 | with_settings :user_format => '' do | |
488 | assert_equal ['users.firstname', 'users.lastname', 'users.id'], User.fields_for_order_statement |
|
488 | assert_equal ['users.firstname', 'users.lastname', 'users.id'], User.fields_for_order_statement | |
489 | end |
|
489 | end | |
490 | end |
|
490 | end | |
491 |
|
491 | |||
492 | def test_fields_for_order_statement_with_invalid_format_should_return_default |
|
492 | def test_fields_for_order_statement_with_invalid_format_should_return_default | |
493 | with_settings :user_format => 'foo' do |
|
493 | with_settings :user_format => 'foo' do | |
494 | assert_equal ['users.firstname', 'users.lastname', 'users.id'], User.fields_for_order_statement |
|
494 | assert_equal ['users.firstname', 'users.lastname', 'users.id'], User.fields_for_order_statement | |
@@ -614,7 +614,7 class UserTest < ActiveSupport::TestCase | |||||
614 | @auth_source.account_password = '' |
|
614 | @auth_source.account_password = '' | |
615 | @auth_source.save! |
|
615 | @auth_source.save! | |
616 | end |
|
616 | end | |
617 |
|
617 | |||
618 | context "with a successful authentication" do |
|
618 | context "with a successful authentication" do | |
619 | should "create a new user account if it doesn't exist" do |
|
619 | should "create a new user account if it doesn't exist" do | |
620 | assert_difference('User.count') do |
|
620 | assert_difference('User.count') do | |
@@ -623,7 +623,7 class UserTest < ActiveSupport::TestCase | |||||
623 | end |
|
623 | end | |
624 | end |
|
624 | end | |
625 | end |
|
625 | end | |
626 |
|
626 | |||
627 | context "with an unsuccessful authentication" do |
|
627 | context "with an unsuccessful authentication" do | |
628 | should "return nil" do |
|
628 | should "return nil" do | |
629 | assert_nil User.try_to_login('example1', '11111') |
|
629 | assert_nil User.try_to_login('example1', '11111') |
General Comments 0
You need to be logged in to leave comments.
Login now