Sha256: d0576c08bcb94cd83aaace3717a2b601fedc90c56939ab191af7f56f3f1cec3b

Contents?: true

Size: 1.24 KB

Versions: 2

Compression:

Stored size: 1.24 KB

Contents

require "test_helper"

class TurbolinksFormTest < ApplicationSystemTestCase
  setup do
    visit new_turbolinks_form_path
  end

  test "It can submit a form with a POST method" do
    shadow_fill_in 'sl-input[label="Name"]', with: "Yuki Nishijima"
    shadow_fill_in 'sl-range[name="user[score]"]', with: "50"

    find('sl-radio', text: "New York").click # Selecting a radio button does not work...

    sl_select "Tokyo", from: "Select one"
    sl_multi_select "Tokyo", "New York", from: "Select two or more"
    sl_check "Remember me"
    sl_toggle "Subscribe to emails"
    shadow_fill_in 'sl-textarea[name="user[description]"]', "textarea", with: "I am a human."

    find("sl-button", text: "Create User").click

    assert_current_path turbolinks_forms_path
    assert_text "Name: Yuki Nishijima"
    assert_text "Description: I am a human."
    assert_text "Color: #ffffff"
    assert_text "Score: 50"
    # assert_text "Current City:"
    assert_text "Previous City: tokyo"
    assert_text 'Past Cities: ["tokyo", "new_york"]'
    assert_text "Remember Me: 1"
    assert_text "Subscribe To Emails: 1"
  end

  test "It can handle an error form submission" do
    find("sl-button", text: "Create User").click

    assert_text "Name can't be blank"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shoelace-rails-0.2.0 test/dummy_app/test/system/turbolinks_form_test.rb
shoelace-rails-0.1.0 test/dummy_app/test/system/turbolinks_form_test.rb