This file contains 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
# before | |
Factory.define :base_post, :class => Post do |h| | |
h.name "Demo" | |
... | |
end | |
#after | |
Factory.define :base_post, :class => "Post" do |h| | |
h.name "Demo" | |
... |
This file contains 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 Capybara::Server | |
def self.manual_host=(value) | |
@manual_host = value | |
end | |
def self.manual_host | |
@manual_host ||= 'localhost' | |
end | |
def url(path) | |
if path =~ /^http/ |
This file contains 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
Before ('@subdomain') do | |
Capybara::Server.manual_host = "subdomain.myapp.local" | |
Capybara.default_host = "subdomain.example.org" | |
end | |
After ('@subdomain') do | |
Capybara.default_host = "example.org" | |
Capybara::Server.manual_host = "myapp.local" | |
end |
This file contains 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
Night Load (2.5ms) SELECT * FROM `nights` WHERE (`nights`.room_type_id = 1) ORDER BY date ASC | |
app/helpers/admin/nights_helper.rb:68:in `nights_form_helper' | |
app/views/admin/nights/edit.html.haml:13 | |
haml (3.0.10) rails/./lib/haml/helpers/action_view_mods.rb:225:in `call' | |
haml (3.0.10) rails/./lib/haml/helpers/action_view_mods.rb:225:in `form_for_without_live_validations' | |
haml (3.0.10) lib/haml/helpers.rb:588:in `call' | |
haml (3.0.10) lib/haml/helpers.rb:588:in `haml_bind_proc' | |
.... | |
dragonfly (0.6.1) lib/dragonfly/middleware.rb:13:in `call' |
This file contains 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
script/plugin install git://github.com/ntalbott/query_trace.git |
This file contains 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
ENV["RACK_ENV"] = 'test' | |
require 'rspec' | |
require 'test/unit' | |
require 'rack/test' | |
require "sinatra/async/test" | |
module AppRunner | |
def app | |
My::App.new | |
end |
This file contains 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 "spec_helper" | |
require "sinatra/async/test" | |
require 'test/unit' | |
module My | |
describe App do | |
include Sinatra::Async::Test::Methods | |
include Test::Unit::Assertions | |
def app | |
App |
This file contains 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
#some_object_controller.rb | |
class SomeObjectController < ApplicationController | |
def search | |
@search_results = SomeClass.find(params[:search_term]) | |
end | |
end | |
# search.html.haml | |
- if @search_results.count > 0 | |
- @search_results.each do |result| |
This file contains 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
#some_object_controller.rb | |
class SomeObjectController < ApplicationController | |
def search | |
@search_results = SomeClass.find(params[:search_term]) | |
if @search_results.count > 0 | |
render :search_results | |
else | |
render :no_search_results | |
end |
This file contains 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 SomeObjectController < ApplicationController | |
def show | |
@object = SomeObject.find(params[:id]) | |
render @object.status | |
end | |
end |
OlderNewer