Sha256: 95a6cf2db15bdf434b6f88331d5653ce624331149acb6d36344e5debb300a050

Contents?: true

Size: 1.99 KB

Versions: 3

Compression:

Stored size: 1.99 KB

Contents

require 'rails_helper'

RSpec.describe 'routing to functions', type: :routing do
  before(:each) do
    @function = create(:keppler_frontend_functions)
  end

  it 'routes GET /admin/frontend/functions/' do
    expect(get: "/admin/frontend/functions/").to route_to(
      controller: 'keppler_frontend/admin/functions',
      action: 'index'
    )
  end

  it 'routes GET /admin/frontend/functions/new' do
    expect(get: "/admin/frontend/functions/new").to route_to(
      controller: 'keppler_frontend/admin/functions',
      action: 'new'
    )
  end

  it 'routes POST /admin/frontend/functions/create' do
    expect(post: "/admin/frontend/functions").to route_to(
      controller: 'keppler_frontend/admin/functions',
      action: 'create'
    ) 
  end

  it 'routes GET /admin/frontend/functions/:id/edit' do
    expect(get: "/admin/frontend/functions/#{@function.id}/edit").to route_to(
      controller: 'keppler_frontend/admin/functions',
      action: 'edit',
      id: @function.id.to_s
    )
  end

  it 'routes PATCH /admin/frontend/functions/:id' do
    expect(patch: "/admin/frontend/functions/#{@function.id}").to route_to(
      controller: 'keppler_frontend/admin/functions',
      action: 'update',
      id: @function.id.to_s
    ) 
  end

  it 'routes GET /admin/frontend/functions/:id' do
    expect(get: "/admin/frontend/functions/#{@function.id}").to route_to(
      controller: 'keppler_frontend/admin/functions',
      action: 'show',
      id: @function.id.to_s
    )
  end

  it 'routes POST /admin/frontend/functions/:id/editor/save' do
    expect(post: "/admin/frontend/functions/#{@function.id}/editor/save").to route_to(
      controller: 'keppler_frontend/admin/functions',
      action: 'editor_save',
      function_id: @function.id.to_s
    )
  end

  it 'routes DELETE /admin/frontend/functions/:id' do
    expect(delete: "/admin/frontend/functions/#{@function.id}").to route_to(
      controller: 'keppler_frontend/admin/functions',
      action: 'destroy',
      id: @function.id.to_s
    )
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
keppler-2.1.18 installer/core/spec/routing/keppler_frontend/functions_spec.rb
keppler-2.1.17 installer/core/spec/routing/keppler_frontend/functions_spec.rb
keppler-2.1.16 installer/core/spec/routing/keppler_frontend/functions_spec.rb