Skip to content

Instantly share code, notes, and snippets.

require 'test_helper'
module RailsTest
class TestableController < ActionController::Base
def test_action
render text: "Success"
end
end
class TestCaseTest < ActionController::TestCase
require "test_helper"
class FactoryGirlTest < ActiveSupport::TestCase
class User < ActiveRecord::Base
end
@@count = 0
def self.count=(value); @@count = value; end
def self.count; @@count; end
@eric-smartlove
eric-smartlove / carrier_wave_test.rb
Created April 1, 2012 15:54
Test file showing that CarrierWave 0.6 sometimes writes in real fog repository when fog is mocked
require 'test_helper'
# This test class allows us to test CarrierWave specific behaviour, the application relies on.
class CarrierWaveTest < ActiveSupport::TestCase
# We define an artificial ActiveRecord class using CarrierWave and fog.
class TestUser < ActiveRecord::Base
mount_uploader :avatar do
storage :fog
def store_dir