cirandas.net

ref: master

plugins/custom_routes/test/integration/custom_routes_test.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require 'test_helper'

class CustomRoutesTest < ActionDispatch::IntegrationTest

  def setup
    create_user('ze')
    @route = CustomRoutesPlugin::Route.create(
      source_url: '/source',
      target_url: '/profile/ze',
      environment_id: Environment.default.id
    )
  end

  should 'create a new route mapping' do
    get @route.source_url
    assert_template "profile/index"
  end

  should 'not map disabled route' do
    @route.update(enabled: false)
    get @route.source_url
    assert_template "shared/not_found"
  end

end