Skip to content

Commit

Permalink
adapt quotes system test to turbo frame
Browse files Browse the repository at this point in the history
  • Loading branch information
dalima-dev committed Jul 21, 2024
1 parent addf3fd commit 134f5b3
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions test/system/quotes_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,38 @@

class QuotesTest < ApplicationSystemTestCase
setup do
@quote = quotes(:first) # Reference to the first fixture quote
@quote = quotes(:first)
end

test 'Showing a quote' do
visit quotes_path
click_link @quote.name

assert_selector 'h1', text: @quote.name
end

test 'Creating a new quote' do
visit quotes_path
assert_selector 'h1', text: 'Quotes'

click_on 'New quote'
assert_selector 'h1', text: 'New quote'

fill_in 'Name', with: 'Capybara quote'

assert_selector 'h1', text: 'Quotes'
click_on 'Create quote'

assert_selector 'h1', text: 'Quotes'
assert_text 'Capybara quote'
end

test 'Showing a quote' do
visit quotes_path
click_link @quote.name

assert_selector 'h1', text: @quote.name
end

test 'Updating a quote' do
visit quotes_path
assert_selector 'h1', text: 'Quotes'

click_on 'Edit', match: :first
assert_selector 'h1', text: 'Edit quote'

fill_in 'Name', with: 'Updated quote'

assert_selector 'h1', text: 'Quotes'
click_on 'Update quote'

assert_selector 'h1', text: 'Quotes'
Expand Down

0 comments on commit 134f5b3

Please sign in to comment.