Sha256: a71db88b9f6f9e447d3def8b61beee1797b379664c1d4ccb36ad99bf85db5dd2

Contents?: true

Size: 781 Bytes

Versions: 1

Compression:

Stored size: 781 Bytes

Contents

require 'test_helper'

class MusiciansController < ApplicationController
end

class UrlHelperTest < MiniTest::Spec
  include Cell::Testing
  controller MusiciansController

  class Cell < Cell::ViewModel
    def show
      url_for(model)
    end
  end

  let (:song_cell) { Cell.new(Song.new, controller: controller) }

  # path helpers work in cell instance.
  it { song_cell.songs_path.must_equal "/songs" }
  it { song_cell.().must_equal "http://test.host/songs/1" }
end


class UrlTest < ActionDispatch::IntegrationTest
  include ::Capybara::DSL

  it do
    visit "/songs/new" # cell.url_for(Song.new)
    page.text.must_equal "http://www.example.com/songs/1"
  end

  # it do
  #   visit "/songs/1/edit"
  #   page.text.must_equal "http://www.example.com/songs/1"
  # end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cells-4.0.0.rc1 test/rails4.2/test/integration/url_helper_test.rb