Sha256: 7bb26952de4c0d073e91657df21d20443b7b84d3e47c5f0e7e3273afdb71b329

Contents?: true

Size: 831 Bytes

Versions: 6

Compression:

Stored size: 831 Bytes

Contents

ENV["RAILS_ENV"] = "test"

##
# Boot rails_app and load the schema.
##

require "fixtures/rails_app/config/environment"
require "fixtures/rails_app/db/schema"

require "rails/test_help"
require "factories"

class ActiveSupport::TestCase

  self.use_transactional_fixtures = true
  self.use_instantiated_fixtures  = false

  def admin_sign_in
    @typus_user = Factory(:typus_user)
    set_session
  end

  def editor_sign_in
    @typus_user = Factory(:typus_user, :email => "editor@example.com", :role => "editor")
    set_session
  end

  def designer_sign_in
    @typus_user = Factory(:typus_user, :email => "designer@example.com", :role => "designer")
    set_session
  end

  def set_session
    @request.session[:typus_user_id] = @typus_user.id
  end

  def reset_session
    @request.session[:typus_user_id] = nil
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
typus-3.1.0.rc6 test/test_helper.rb
typus-3.1.0.rc5 test/test_helper.rb
typus-3.1.0.rc4 test/test_helper.rb
typus-3.1.0.rc3 test/test_helper.rb
typus-3.1.0.rc2 test/test_helper.rb
typus-3.1.0.rc1 test/test_helper.rb