This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it 'finds posts containing the given word in the title' do | |
# The titles are in a different file than the test, so you need to flip back and forth to see | |
# what's actually going on here. When somebody adds another example post to the fixtures, this | |
# test will start failing, which is a distraction and a waste of time. We were also never able to | |
# come up with fixtures that weren't either hopelessly entangled or completely bloated from adding | |
# a specific fixture for almost every test. | |
Post.search('example').map(&:title).should =~ ['example one', 'example two'] | |
end | |
it 'finds posts containing the given word in the title' do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Paperclip | |
class Geometry | |
def self.from_file file | |
parse("100x100") | |
end | |
end | |
class Thumbnail | |
def make | |
src = Test::FileHelper.fixture_file('white_pixel.jpg') | |
dst = Tempfile.new([@basename, @format].compact.join(".")) |