-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selam Ainalem - Amperes #24
base: master
Are you sure you want to change the base?
Conversation
…o account for information coming from Git auth-hash. Also, modified log-in/log-out to utilize Oauth.
…include - all media, all users, and add new work.
MediaRanker RevistedWhat We're Looking For
|
} | ||
|
||
# Create mock account with user | ||
OmniAuth.config.mock_auth[:github] = OmniAuth::AuthHash.new(@riley_git_hash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You really should DRY this up using the login method in the test_helper.rb file.
end | ||
|
||
describe 'Destroy' do | ||
it 'will log out a user' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about guest users?
|
||
describe 'Index' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No testing for guest users!
flash[:status].must_equal :failure | ||
flash[:result_text].must_equal "Could not create book" | ||
flash[:messages][:title].size.must_equal 1 | ||
flash[:messages][:title][0].must_equal "can't be blank" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be more flexible to have:
flash[:messages][:title].must_contain "can't be blank"
post works_path, | ||
params: | ||
{work: | ||
{rating: "5", creator: "world", description: "foo", publication_year: 2008, category: "album"}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is "album" a bogus category?
Maybe this test would be better named, with bogus data.
|
||
flash[:status].must_equal :failure | ||
flash[:result_text].must_equal "Could not create album" | ||
assert_operator flash[:messages][:title].size,:>, 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're missing assert-style and spec-style testing.
You can use
flash[:messages][:title].must_be :>, 0
|
||
it "renders 404 not_found for a bogus work ID" do | ||
it "redirects to the work page after the user has logged out" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test seems a mishmash of things being tested.
|
||
it "succeeds with no media" do | ||
|
||
describe 'Guest User-tests' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to test the other routes with guest users and verify that they're redirected.
No description provided.