Sha256: e798d06baac65f829df16a38288b98234cf053a608b28ac9082ac5595fdbe4e2

Contents?: true

Size: 554 Bytes

Versions: 10

Compression:

Stored size: 554 Bytes

Contents

require 'test_helper'

describe BlocksController do
  let(:valid_params) { { document: { name: 'Sample' } } }

 it 'has one response block' do
   post :create, valid_params

   must_redirect_to root_path
 end

 it 'has two response blocks with success' do
   params = valid_params.merge id: 100
   post :update, params

   must_redirect_to root_path
 end

 it 'has two response blocks with failire' do
   params = valid_params.merge(id: 100).tap do |p|
     p[:document][:name] = ''
   end

   post :update, params

   must_render_template :new
 end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
restful_controller-0.1.5 test/blocks_controller_test.rb
restful_controller-0.1.4 test/blocks_controller_test.rb
restful_controller-0.1.3 test/blocks_controller_test.rb
restful_controller-0.1.2 test/blocks_controller_test.rb
restful_controller-0.1.1 test/blocks_controller_test.rb
restful_controller-0.1.0 test/blocks_controller_test.rb
restful_controller-0.0.5 test/blocks_controller_test.rb
restful_controller-0.0.4 test/blocks_controller_test.rb
restful_controller-0.0.3 test/blocks_controller_test.rb
restful_controller-0.0.2 test/blocks_controller_test.rb