Created
October 23, 2014 10:06
-
-
Save thiagoramos23/aef70cb396dd5b2a7b7e to your computer and use it in GitHub Desktop.
New Residence Spec
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 'rails_helper' | |
RSpec.describe Admin::ResidencesController do | |
let(:user) { build_stubbed(:user) } | |
context "#valid_user" do | |
describe '#new' do | |
before { | |
sign_in user | |
get :new | |
} | |
it_behaves_like "renderable action", :new | |
it "assigns @residence to a new Residence" do | |
expect(assigns(:residence)).to be_a_new(Residence) | |
end | |
end | |
end | |
include_context 'redirect to sign in' do | |
let(:before_action) { get :new } | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment