2013-07-11 03:00:06 +00:00
|
|
|
# Responsability
|
|
|
|
# Test whether rails version > 4
|
|
|
|
# includes attr_accessible if < 4
|
2013-07-12 01:48:23 +00:00
|
|
|
require 'minitest_helper'
|
2013-07-11 03:09:58 +00:00
|
|
|
require 'impressionist/rails_toggle'
|
|
|
|
|
|
|
|
module Impressionist
|
|
|
|
describe RailsToggle do
|
|
|
|
|
2013-07-12 01:48:23 +00:00
|
|
|
before {
|
|
|
|
@toggle = RailsToggle.new
|
|
|
|
}
|
2013-07-11 04:43:04 +00:00
|
|
|
|
2013-07-12 01:48:23 +00:00
|
|
|
describe "Rails 4" do
|
2013-07-11 04:43:04 +00:00
|
|
|
|
2013-07-12 01:48:23 +00:00
|
|
|
# see your_minitest_path/lib/minitest/mock.rb
|
|
|
|
it "must not include attr_accessible" do
|
|
|
|
@toggle.stub :ask_rails, false do
|
|
|
|
refute @toggle.should_include?
|
|
|
|
end
|
2013-07-11 04:43:04 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2013-07-11 03:09:58 +00:00
|
|
|
end
|
|
|
|
end
|