-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: system tests for creating rooms and messages
- Loading branch information
1 parent
3f52106
commit b4df24d
Showing
3 changed files
with
32 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,19 @@ | ||
require "application_system_test_case" | ||
|
||
class UserCreatesAMessageTest < ApplicationSystemTestCase | ||
test "User creates a message" do | ||
visit rooms_url | ||
click_button("+") | ||
assert current_path = new_room_path | ||
fill_in("Name", with: "test room") | ||
click_button("Create Room") | ||
assert_selector "div", text: "test room" | ||
click_link("test room") | ||
room = Room.last | ||
assert current_path = room_path(room.id) | ||
fill_in("message[content]", with: "my test message") | ||
click_button("Send") | ||
assert_selector "div", text: "my test message" | ||
assert_selector "div", text: "Sent at:" | ||
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,12 @@ | ||
require "application_system_test_case" | ||
|
||
class UserCreatesNewRoomsTest < ApplicationSystemTestCase | ||
test "creating a new room" do | ||
visit rooms_url | ||
click_button("+") | ||
assert current_path = new_room_path | ||
fill_in("Name", with: "test room") | ||
click_button("Create Room") | ||
assert_selector "div", text: "test room" | ||
end | ||
end |