Sha256: 00811ba21063106898cc88a9eb30ac1aade093eb1967d91678816b7bfeba6bc4
Contents?: true
Size: 1.96 KB
Versions: 2
Compression:
Stored size: 1.96 KB
Contents
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. # # It only uses APIs available in rails and/or rspec-rails. There are a number # of tools you can use to make these specs even more expressive, but we're # sticking to rails and rspec-rails APIs to keep things simple and stable. # # Compared to earlier versions of this generator, there is very limited use of # stubs and message expectations in this spec. Stubs are only used when there # is no simpler way to get a handle on the object needed for the example. # Message expectations are only used when there is no simpler way to specify # that an instance is receiving a specific message. describe PrivatePostsController do # This should return the minimal set of attributes required to create a valid # PrivatePost. As you add validations to PrivatePost, be sure to # adjust the attributes here as well. let(:valid_attributes) { FactoryGirl.attributes_for(:private_post) } let(:invalid_attributes) { FactoryGirl.attributes_for(:invalid_private_post) } # This should return the minimal set of values that should be in the session # in order to pass any filters (e.g. authentication) defined in # PrivatePostsController. Be sure to keep this updated too. let(:valid_session) { {} } describe "actions" do it "all require authentication" do # That's true for all actions, yet I think there's no need to repeat them all here. lambda { get :index, {}, valid_session }.should raise_exception(RuntimeError) lambda { get :new, {}, valid_session }.should raise_exception(RuntimeError) end end end
Version data entries
2 entries across 2 versions & 1 rubygems