-
Notifications
You must be signed in to change notification settings - Fork 927
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add system test with osm website oauth app registration
- Loading branch information
1 parent
f41bb4c
commit 169513e
Showing
2 changed files
with
28 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
require "application_system_test_case" | ||
require "website_oauth_application_system_test_case" | ||
|
||
class NoteCommentsTest < ApplicationSystemTestCase | ||
def test_action_text | ||
class NoteCommentsTest < WebsiteOauthApplicationSystemTestCase | ||
def test_add_comment | ||
note = create(:note_with_comments) | ||
sign_in_as(create(:user)) | ||
user = create(:user) | ||
sign_in_as(user) | ||
visit note_path(note) | ||
|
||
assert_no_content "Comment from #{user.display_name}" | ||
assert_no_content "Some newly added note comment" | ||
assert_button "Resolve" | ||
assert_button "Comment", :disabled => true | ||
|
||
fill_in "text", :with => "Some text" | ||
fill_in "text", :with => "Some newly added note comment" | ||
|
||
assert_button "Comment & Resolve" | ||
assert_button "Comment" | ||
assert_button "Comment", :disabled => false | ||
|
||
click_button "Comment" | ||
|
||
assert_content "Comment from #{user.display_name}" | ||
assert_content "Some newly added note comment" | ||
end | ||
end |
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,14 @@ | ||
require "application_system_test_case" | ||
|
||
class WebsiteOauthApplicationSystemTestCase < ApplicationSystemTestCase | ||
def before_setup | ||
super | ||
osm_website_app = create(:oauth_application, :name => "OpenStreetMap Web Site", :scopes => "write_api write_notes") | ||
Settings.oauth_application = osm_website_app.uid | ||
end | ||
|
||
def after_teardown | ||
Settings.reload! | ||
super | ||
end | ||
end |