Sha256: 763c05ec9cc652ee4204f81bfa5884c6ed03cfc749233bf5ab48c409b95e5d1a

Contents?: true

Size: 893 Bytes

Versions: 1

Compression:

Stored size: 893 Bytes

Contents

require "test_helper"

class SongsControllerTest < Trailblazer::Test::Integration
  let(:song) do
    Song::Create.(
      { title: 'Song Title' },
      "current_user" => 'user_name'
    )["model"]
  end

  it "new" do
    visit "/songs/new"
    page.must_have_css "form.new_song[action='/songs']"
  end

  it "show" do
    visit "/songs/#{song.id}"
    page.must_have_css "h1", visible: "Skin Trade"
  end

  it "create" do
    visit "/songs/new"
    fill_in "song_title", with: "Out Of My Mind"
    click_button "Create Song"
    page.must_have_css "h1", visible: "Skin Trade"
  end

  it "new_with_result" do
    visit "/songs/new_with_result"
    page.must_have_css "h1", visible: "Song"
  end

  it 'update' do
    visit "songs/#{song.id}/edit"

    fill_in "song_title", with: "Out Of My Mind"
    click_button "Update Song"
    page.must_have_css "h1", visible: "Skin Trade"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
trailblazer-future-2.1.0.rc1 test/rails5.0/test/integration/songs_controller_test.rb