-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly nest returning judgements for a book under the book route (#…
…1187) * Properly nest returning judgements for a book under the /book/:book_id/judgements route * Update test * Simplify test * Tweak rubocop rules
- Loading branch information
Showing
9 changed files
with
134 additions
and
100 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
File renamed without changes.
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 |
---|---|---|
|
@@ -337,6 +337,23 @@ class UserTest < ActiveSupport::TestCase | |
assert user.valid? | ||
end | ||
end | ||
|
||
describe 'The full name of the user' do | ||
it 'uses the name if possible' do | ||
user = User.new(name: 'bob') | ||
assert 'bob', user.fullname | ||
end | ||
|
||
it 'uses the email if no name' do | ||
user = User.new(email: '[email protected]') | ||
assert '[email protected]', user.fullname | ||
end | ||
|
||
it 'handles it when we got nothing!' do | ||
user = User.new | ||
assert 'Anonymous', user.fullname | ||
end | ||
end | ||
end | ||
|
||
# rubocop:enable Layout/LineLength |