-
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.
Do not allow to show non-shared searches
Signed-off-by: Miquel Sabaté Solà <[email protected]>
- Loading branch information
Showing
2 changed files
with
17 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
class SharedSearchesControllerTest < ActionDispatch::IntegrationTest | ||
# We need the session to be initialized as a signed in user. | ||
setup { post sessions_url, params: { username: users(:user).username, password: '12341234' } } | ||
|
||
test 'does not allow to show searches which have not been shared' do | ||
get search_shared_url(searches(:search1).id) | ||
assert_equal @response.code.to_i, 404 | ||
|
||
searches(:search1).update!(shared: true) | ||
|
||
get search_shared_url(searches(:search1).id) | ||
assert_equal @response.code.to_i, 200 | ||
end | ||
end |