Sha256: 3ed4e24326473271f810880ca9413230f294bcd6bff7f6a769d2339f8b030c4c

Contents?: true

Size: 537 Bytes

Versions: 1

Compression:

Stored size: 537 Bytes

Contents

# -*- coding: utf-8 -*-
require 'test_helper'

class UsersControllerTest < ActionController::TestCase
  setup do
    User.create(:name => 'yalab', :age => '4', :secret => 'secret')
    I18n.locale = :ja
    @csv = User.all.to_csv(:fields => [:id, :name, :age])
  end
  test "should get index" do
    get :index, :format => 'csv'
    assert_equal @csv, response.body
  end

  test "should get sjis" do
    get :sjis, :format => 'csv'
    assert_equal @csv.encode('SJIS'), response.body
  end
  teardown do
    I18n.locale = :en
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
csv_rails-0.4.1 test/dummy/test/functional/users_controller_test.rb