Sha256: 016b767c7a0fde1e093cf11e6550b444993465509277cae9b45ba5faec9d1a23

Contents?: true

Size: 927 Bytes

Versions: 1

Compression:

Stored size: 927 Bytes

Contents

require 'spec_helper'

module Platon
  RSpec.describe FormsController, type: :controller do
    routes { Platon::Engine.routes }
    describe 'GET #show' do
      let(:params) {
        { data: {amount: 100.25, currency: 'UAH', description: 'Desc', name: 'rails way'}, id: 1, ext: [{reserve: 'UUID'}] }
      }
      it do
        get :show, params: params.merge(format: 'application/json')
        expect(assigns(:service)).to respond_to :form_prop
        expect(assigns(:service)).to respond_to :fields
      end
    end
  end

  RSpec.describe FormsController, type: :request do
    let(:params) {
      { data: {amount: 100.25, currency: 'UAH', description: 'Desc', name: 'rails way'}, id: 1, ext: [{reserve: 'UUID'}] }
    }
    
    describe 'GET #show as HTML' do
      it do
        get '/platon/forms', params: params.merge(format: :html)
        expect(response).to render_template(:show)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
platon.ua-1.0.1 spec/controllers/platon/forms_controller_spec.rb