Sha256: c9e56817b7d4b817e3415f4562a256cc046543d5b42bb4c03a2705616f87d318

Contents?: true

Size: 633 Bytes

Versions: 5

Compression:

Stored size: 633 Bytes

Contents

require 'spec_helper'

describe 'csv renderer', type: :controller do
  controller do
    def object
      render csv: Post.new(name: 'a')
    end

    def array
      render csv: [Post.new(name: 'b'), Category.new(name: 'c')]
    end
  end

  before do
    routes.draw { get ':controller/:action' }
  end

  it 'renders an object' do
    get :object
    expect(response.body).to include('a')
  end

  it 'renders an array' do
    get :array

    expect(response.body).to include('b')
    expect(response.body).to include('c')
  end

  describe 'filename option'
  describe 'serializer option'
  describe 'each_serializer option'
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
csverizer-0.0.7 spec/renderer_spec.rb
csverizer-0.0.6 spec/renderer_spec.rb
csverizer-0.0.5 spec/renderer_spec.rb
csverizer-0.0.4 spec/renderer_spec.rb
csverizer-0.0.3 spec/renderer_spec.rb