Skip to content

Commit b5a5b42

Browse files
authored
Merge pull request #73 from amatsuda/search_test
A test for message search
2 parents fc52233 + 821762a commit b5a5b42

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.github/workflows/rails.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: bin/rails db:schema:load
3939
# Add or replace test runners here
4040
- name: Run tests
41-
run: bin/rake
41+
run: bin/rails test:system test
4242

4343
lint:
4444
runs-on: ubuntu-latest
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require "test_helper"
22

33
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
4-
driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
4+
driven_by :selenium, using: :headless_chrome, screen_size: [1400, 1400]
55
end

test/system/messages_test.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ class MessagesTest < ApplicationSystemTestCase
1616
click_link @message2.attachments_attachments.first.blob.filename.to_s
1717
end
1818

19-
test "visiting the index" do
19+
test 'visiting the search page, and searching a message' do
2020
visit messages_url
21-
assert_selector "h1", text: "Messages"
22-
end
21+
assert_selector "h1", text: "blade.ruby-lang.org"
22+
23+
fill_in :q, with: @message1.body
24+
click_button 'Search'
2325

26+
assert_content @message1.subject
27+
end
2428
end

0 commit comments

Comments
 (0)