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
this page https://github.com/rspec/rspec-rails | |
tells me to do this... | |
describe "events/show" do | |
it "displays the event location" do | |
assign(:event, stub_model(Event, | |
:location => "Chicago" | |
)) | |
render | |
rendered.should contain("Chicago") |
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 'spec_helper' | |
# This spec was generated by rspec-rails when you ran the scaffold generator. | |
# It demonstrates how one might use RSpec to specify the controller code that | |
# was generated by Rails when you ran the scaffold generator. | |
# | |
# It assumes that the implementation code is generated by the rails scaffold | |
# generator. If you are using any extension libraries to generate different | |
# controller code, this generated spec may or may not pass. | |
# |
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 'spec_helper' | |
describe "Session" do | |
describe "GET /auth/facebook and /session/create (same as /auth/facebook/callback)" do | |
it "triggers callback, creates Bob and redirects to root" do | |
expect do | |
get '/auth/facebook' | |
end.to change(User, :count).by(1) && change(Login, :count).by(1) | |
response.status.should be(200) |
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
Failed examples: | |
rspec ./spec/controllers/users_controller_spec.rb:96 # UsersController POST create with invalid params re-renders the 'new' template | |
rspec ./spec/controllers/users_controller_spec.rb:139 # UsersController PUT update with invalid params re-renders the 'edit' template | |
Running: spec/controllers/users_controller_spec.rb spec/routing/users_routing_spec.rb | |
........F....F......... | |
Failures: | |
1) UsersController POST create with invalid params re-renders the 'new' template |
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
GIT | |
remote: git://github.com/tchandy/octopus.git | |
revision: f3410d73889469a1456dc0c72b7f6942653e2d31 | |
specs: | |
ar-octopus (0.4.0) | |
activerecord (>= 2.3.0) | |
GEM | |
remote: http://rubygems.org/ | |
specs: |
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 'spec_helper' | |
describe "bands/show" do | |
before(:each) do | |
@band = assign(:band, Fabricate(:band)) | |
end | |
it "renders page" do | |
render | |
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 Ability | |
include CanCan::Ability | |
def initialize(user) | |
user ||= User.new # guest user | |
can :read, Band | |
can :create, Band do |band| | |
user.persisted? | |
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
Fabricator(:state) do | |
name { Faker::Address.city } | |
end | |
Fabricator(:city) do | |
state #{ Fabricate(:state) } | |
name { Faker::Address.city } | |
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
Failures: | |
1) SessionsController GET 'destroy' returns http success | |
Failure/Error: get 'destroy' | |
NameError: | |
undefined local variable or method `root_path' for #<SessionsController:0x9c8a088> | |
# ./app/controllers/sessions_controller.rb:20:in `destroy' | |
# ./spec/controllers/sessions_controller_spec.rb:18:in `block (3 levels) in <top (required)>' | |
2) users/index renders a list of users |
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
SELECT `sales`.* FROM `sales` | |
INNER JOIN `properties` ON `properties`.`id` = `sales`.`property_id` | |
WHERE (properties.zip = 33160) | |
ORDER BY sale_date DESC | |
LIMIT 10 | |
Duration 56,163 ms | |
Explain |