Last active
August 29, 2015 14:03
-
-
Save walidvb/169241e7712bc4b94968 to your computer and use it in GitHub Desktop.
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
1) WebReadsController when the book is published and the user is subscribed should display only published chapters | |
Failure/Error: get :show, id: @book | |
ActionController::UrlGenerationError: | |
No route matches {:id=>"slug_32", :controller=>"web_reads", :action=>"show"} | |
# ./spec/controllers/web_reads_controller_spec.rb:20:in `block (4 levels) in <top (required)>' |
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
resources :books, only: [:show] do | |
resource :web_read, only: [:show] | |
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 WebReadsController < ApplicationController | |
def show | |
end | |
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' | |
describe WebReadsController do | |
context "when the book is not published" do | |
it "should redirect" do | |
get 'show' | |
response.should redirect_to(root_url) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment