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
<%= form_tag "#" do %> | |
<%= select_tag "name", grouped_options_for_select("Group 1" => ["value 1", "value 2"], "Group 2" => ["value 3", "value 4"]) %> | |
<% 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
require 'bundler' | |
Bundler.setup(:default) | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
# This connection will do for database-independent bug reports. | |
ActiveRecord::Base.establish_connection(adapter: 'postgresql', database: 'test123') | |
ActiveRecord::Base.logger = Logger.new(STDOUT) |
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
class PhotosController < ApplicationController | |
def show | |
if params.has_key? :time | |
@main_photo = "http://www.google.com/images/srpr/logo11w.png" | |
end | |
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
class Developer | |
def salery | |
5000 | |
end | |
end | |
class Manager | |
def salery | |
8000 | |
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
require 'bundler' | |
Bundler.setup(:default) | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
# This connection will do for database-independent bug reports. | |
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') | |
ActiveRecord::Base.logger = Logger.new(STDOUT) |
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
diff --git a/guides/source/testing.md b/guides/source/testing.md | |
index 32140be..f2e0f82 100644 | |
--- a/guides/source/testing.md | |
+++ b/guides/source/testing.md | |
@@ -223,7 +223,16 @@ Every test must contain at least one assertion, with no restriction as to how ma | |
### Maintaining the test database schema | |
-In order to run your tests, your test database will need to have the current structure. The test helper checks whether your test database has any pending migrations. If so, it will try to load your `db/schema.rb` or `db/structure.sql` into the test database. If migrations are still pending, an error will be raised. | |
+In order to run your tests, your test database will need to have the current |
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
begin | |
require 'bundler/setup' | |
rescue LoadError | |
puts 'You must `gem install bundler` and `bundle install` to run rake tasks' | |
end | |
require 'rdoc/task' | |
RDoc::Task.new(:rdoc) do |rdoc| | |
rdoc.rdoc_dir = 'rdoc' |
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
E, [2015-02-12T03:25:25.223244 #32185] ERROR -- : Actor crashed! | |
Errno::EHOSTDOWN: Host is down @ dir_initialize - <THE/DIRECTORY/LISTEN/WATCHES> | |
/usr/local/rbenv/versions/2.1.5/lib/ruby/2.1.0/pathname.rb:425:in `open' | |
/usr/local/rbenv/versions/2.1.5/lib/ruby/2.1.0/pathname.rb:425:in `foreach' | |
/usr/local/rbenv/versions/2.1.5/lib/ruby/2.1.0/pathname.rb:425:in `children' | |
/path/to/app/vendor/bundle/ruby/2.1.0/gems/listen-2.8.3/lib/listen/directory.rb:14:in `scan' | |
/path/to/app/vendor/bundle/ruby/2.1.0/gems/listen-2.8.3/lib/listen/change.rb:38:in `change' | |
/path/to/app/vendor/bundle/ruby/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `public_send' | |
/path/to/app/vendor/bundle/ruby/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch' | |
/path/to/app/vendor/bundle/ruby/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:63:in `dispatch' |
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
diff --git a/test/fixtures/high_scores.yml b/test/fixtures/high_scores.yml | |
index 0c3721e..9d3b342 100644 | |
--- a/test/fixtures/high_scores.yml | |
+++ b/test/fixtures/high_scores.yml | |
@@ -1,5 +1,7 @@ | |
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html | |
+<% require Rails.root + "test/support/fixture_helper" %> | |
+ | |
one: |
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 --version | |
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14] |