Sha256: 925da6ff9ec7df277745bdca822d56368da6995d8427bbb66c5d17a87ac203bd

Contents?: true

Size: 510 Bytes

Versions: 10

Compression:

Stored size: 510 Bytes

Contents

require 'test_helper'

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

  context 'flash messages' do
    it 'has a notice' do
      post :create, valid_params

      flash[:notice].must_equal 'A new document was created'
      must_redirect_to root_path
    end

    it 'has an alert' do
      params = valid_params.merge id: 100
      put :update, params

      flash[:alert].must_equal 'There are some errors'
      must_redirect_to root_path
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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