- Unit tests are very narrowly focused on testing a single model
- Functional tests are very narrowly focused on testing a single controller and the interactions between the models it employs
- Integration tests are broad story-level tests that verify the interactions between the various actions supported by the application, across all controllers
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
| # config/initializers/acts_as_indexed.rb | |
| ActsAsIndexed.configure do |config| | |
| # Disable acts_as_indexed auto indexing in test by default | |
| config.disable_auto_indexing = Rails.env.test? | |
| end |
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
| # config/initializers/active_record.rb | |
| module ActiveRecord | |
| class Base | |
| # Find by array of IDs, preserving order of IDs | |
| # See http://stackoverflow.com/a/25248122/83743 | |
| def self.find_with_relevance(array_of_ids) | |
| array_of_ids = Array(array_of_ids) unless array_of_ids.is_a?(Array) | |
| self.find(array_of_ids).index_by(&:id).slice(*array_of_ids).values | |
| end |
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
| # db/migrations/20140101000000_add_hstore_field_to_trip_tickets.rb | |
| class AddHstoreFieldToTripTickets < ActiveRecord::Migration | |
| def change | |
| add_column :trip_tickets, :customer_identifiers, :hstore | |
| end | |
| end |
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
| source 'https://rubygems.org' | |
| ruby '2.1.4' | |
| gem 'rails', '~> 3.2.0' | |
| gem 'mysql2' | |
| group :development, :test do | |
| gem 'byebug' |
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
| .ilb { | |
| display: -moz-inline-box; | |
| display: inline-block; | |
| } |
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
| javascript:void(prompt('Result',function(){var a=window.getSelection().toString();if(a.indexOf("\n")>=0){a=a.split("\n");var b=0;for(var i=0;i<a.length;i++){b+=parseFloat(a[i])}}else b=parseFloat(a);return(isNaN(b))?0:b}())); |
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
| macosx:~ chrisb$ irb -rosx/cocoa | |
| /opt/local/lib/ruby/1.8/osx/foundation.rb:8:in `require': no such file to load -- rubycocoa (LoadError) | |
| from /opt/local/lib/ruby/1.8/osx/foundation.rb:8 | |
| from /opt/local/lib/ruby/1.8/osx/cocoa.rb:8:in `require' | |
| from /opt/local/lib/ruby/1.8/osx/cocoa.rb:8 | |
| from /opt/local/lib/ruby/1.8/irb/init.rb:254:in `require' | |
| from /opt/local/lib/ruby/1.8/irb/init.rb:254:in `load_modules' | |
| from /opt/local/lib/ruby/1.8/irb/init.rb:252:in `each' | |
| from /opt/local/lib/ruby/1.8/irb/init.rb:252:in `load_modules' | |
| from /opt/local/lib/ruby/1.8/irb/init.rb:21:in `setup' |
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
| .mouse{ | |
| position: absolute; | |
| background-image: url('../images/cursor.png'); | |
| width: 15px; | |
| height: 22px; | |
| z-index: 100; | |
| } |
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
| # Runs PHP_Beautifier on the current document. | |
| # See http://beautifyphp.sourceforge.net/ for more info. | |
| # Add this as a new command in TextMate | |
| # I used the following additional command settings: | |
| # Save: Nothing | |
| # Input: Document ("Selected Text or", note PHP_Beautifier | |
| # only works on complete PHP documents) | |
| # Output: Replace Document | |
| if [[ "$TM_SOFT_TABS" == "YES" ]]; then |
OlderNewer