Sha256: b10587d7ccd4ab5b33ff92f23c7780ed9a1654fff82364cc62b4d8616b44d878

Contents?: true

Size: 1.25 KB

Versions: 10

Compression:

Stored size: 1.25 KB

Contents

require 'test_helper'

class Kaui::CustomFieldsControllerTest < Kaui::FunctionalTestHelper

  test 'should get index' do
    get :index
    assert_response 200
  end

  test 'should list custom fields' do
    # Test pagination
    get :pagination, :format => :json
    verify_pagination_results!
  end

  test 'should search custom fields' do
    # Test search
    get :pagination, :search => {:search => 'foo'}, :format => :json
    verify_pagination_results!
  end

  test 'should create custom fields' do
    get :new
    assert_response 200
    assert_not_nil assigns(:custom_field)

    # TODO https://github.com/killbill/killbill-client-ruby/issues/17
    {
        :ACCOUNT => @account.account_id,
        :BUNDLE => @bundle.bundle_id,
        :SUBSCRIPTION => @bundle_invoice.items.first.subscription_id,
        :INVOICE => @bundle_invoice.invoice_id
    }.each do |object_type, object_id|
      post :create,
           :custom_field => {
               :object_id => object_id,
               :object_type => object_type,
               :name => SecureRandom.uuid.to_s,
               :value => SecureRandom.uuid.to_s,
           }
      assert_redirected_to custom_fields_path
      assert_equal 'Custom field was successfully created', flash[:notice]
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kaui-0.15.5 test/functional/kaui/custom_fields_controller_test.rb
kaui-0.15.4 test/functional/kaui/custom_fields_controller_test.rb
kaui-0.15.3 test/functional/kaui/custom_fields_controller_test.rb
kaui-0.15.2 test/functional/kaui/custom_fields_controller_test.rb
kaui-0.15.1 test/functional/kaui/custom_fields_controller_test.rb
kaui-0.15.0 test/functional/kaui/custom_fields_controller_test.rb
kaui-0.14.2 test/functional/kaui/custom_fields_controller_test.rb
kaui-0.14.1 test/functional/kaui/custom_fields_controller_test.rb
kaui-0.14.0 test/functional/kaui/custom_fields_controller_test.rb
kaui-0.12.0 test/functional/kaui/custom_fields_controller_test.rb