Created
August 23, 2016 01:53
-
-
Save staycreativedesign/ca58f37fe3448adb90e7a7bd62935dba 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
mindblown@ ~/expect3/Projects/lawyer_template (master) $ zeus test spec/controllers/sessions_controller_spec.rb | |
.*.** | |
Pending: (Failures listed here are expected and do not affect your suite's status) | |
1) SessionsController GET new redirects to admin panel if user is authenticated | |
# Temporarily skipped with xit | |
# ./spec/controllers/sessions_controller_spec.rb:10 | |
2) SessionsController GET new POST create with valid credentials it redirects to admin panel | |
# Temporarily skipped with xit | |
# ./spec/controllers/sessions_controller_spec.rb:22 | |
3) SessionsController GET new POST create with valid credentials it sets the flash message | |
# Temporarily skipped with xit | |
# ./spec/controllers/sessions_controller_spec.rb:23 | |
Finished in 0.15954 seconds (files took 158 minutes 37 seconds to load) | |
5 examples, 0 failures, 3 pending |
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 SessionsController < ApplicationController | |
def new | |
end | |
def create | |
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 'rails_helper' | |
describe SessionsController do | |
describe "GET new" do | |
it "renders the new template for unauthenticated users" do | |
get :new | |
expect(response).to render_template(:new) | |
end | |
xit "redirects to admin panel if user is authenticated" | |
describe "POST create" do | |
context "with valid credentials" do | |
it "creates a valid session" do | |
ben = build(:user, access_level: "admin") | |
post :create, params: {user: ben} | |
expect(session[:user_id]).to eq(ben.id) | |
end | |
xit "it redirects to admin panel" | |
xit "it sets the flash message" | |
end | |
context "with invalid credentials" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment