-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#46 add some integration tests for navigation label
- Loading branch information
1 parent
346a964
commit e3b50d2
Showing
3 changed files
with
48 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
require "test_helper" | ||
|
||
class NavigationLabelTest < ActionDispatch::IntegrationTest | ||
|
||
def setup | ||
Video.destroy_all | ||
end | ||
|
||
def teardown | ||
Video.destroy_all | ||
end | ||
|
||
test "navigation label is overidden" do | ||
|
||
sign_in_dummy_administrator! | ||
|
||
# index view is overridden | ||
visit("/admin/videos") | ||
assert page.has_content?("YouTube Videos") | ||
assert page.has_content?("New YouTube Video") | ||
assert page.has_content?("No YouTube Videos live here") | ||
|
||
# new/edit view is overriden | ||
first(".button.-primary").click | ||
assert page.has_content?("New YouTube Video") | ||
fill_in("video[title]", with:"Neko Atsume") | ||
fill_in("video[youtube_id]", with:"xxxxxxxxxxx") | ||
first(".button[name=save]").click | ||
|
||
# created flash message is overridden | ||
assert page.has_content?("created the YouTube Video"), "should see flash message" | ||
|
||
# show view is overriden | ||
find_link("Inspect").click | ||
assert page.has_content?("YouTube Videos") | ||
assert page.has_content?("Edit This YouTube Video") | ||
|
||
# updated flash message is overriden | ||
first(".button.-primary").click | ||
first(".button[name=save]").click | ||
assert page.has_content?("updated the youtube video"), "should see flash message" | ||
|
||
end | ||
|
||
end |