Skip to content
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

Refactor diary tests #1285

Merged
merged 6 commits into from Sep 15, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions test/controllers/diary_entry_controller_test.rb
Expand Up @@ -404,8 +404,9 @@ def test_list_all
end

def test_list_user
diary_entry = create(:diary_entry)
geo_entry = create(:diary_entry, :latitude => 51.50763, :longitude => -0.10781)
diary_entry = create(:diary_entry, :user_id => users(:normal_user).id)
geo_entry = create(:diary_entry, :user_id => users(:normal_user).id, :latitude => 51.50763, :longitude => -0.10781)
_other_entry = create(:diary_entry, :user_id => users(:public_user).id)

# Try a list of diary entries for a valid user
get :list, :display_name => users(:normal_user).display_name
Expand All @@ -419,6 +420,7 @@ def test_list_user

def test_list_friends
diary_entry = create(:diary_entry, :user_id => friends(:normal_user_with_second_user).friend_user_id)
_other_entry = create(:diary_entry, :user_id => users(:second_public_user).id)

# Try a list of diary entries for your friends when not logged in
get :list, :friends => true
Expand All @@ -434,6 +436,7 @@ def test_list_friends

def test_list_nearby
diary_entry = create(:diary_entry, :user_id => users(:public_user).id)

# Try a list of diary entries for nearby users when not logged in
get :list, :nearby => true
assert_response :redirect
Expand Down