Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8707805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:57:32+00:00 2026-06-13T03:57:32+00:00

I have an app that uses Sorcery (or tries to use it), and I

  • 0

I have an app that uses Sorcery (or tries to use it),
and I am writing the specs for it:

context "successfull attempts to log in" do
  let(:attr) { attributes_for(:credentials) }

  before(:each) do
    @user = create(:user, attr)
  end

  it "should log the user in" do
    post :create, attr.merge(remember_me: false)
    controller.should be_logged_in
  end
end

Here is the FactoryGirl factory:

FactoryGirl.define do
  factory :user do
    email                 Faker::Internet.safe_email
    password              "password"
    password_confirmation { |u| u.password }
    client_id             1
  end

  factory :credentials, class: User do
    email       "user@example.com"
    password    "password"
  end
end

And here is the controller action:

class SessionsController < ApplicationController
  # ...
  def create
    login(params[:email], params[:email], params[:remember_me])
    flash.now[:error] = "Invalid email/password combination"
    render :new
  end
end

The error message is the following:

1) SessionsController POST 'create' successfull attempts to log in should log the user in
     Failure/Error: controller.should be_logged_in
       expected logged_in? to return true, got false
     # ./spec/controllers/sessions_controller_spec.rb:54:in `block (4 levels) in <top (required)>'

The spec keeps failing for some reason. Could anyone explain to me why please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:57:34+00:00Added an answer on June 13, 2026 at 3:57 am

    Your controller uses the email as both the username and password, which looks like a copy and paste error. Is that correct?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have an app that uses git for version control. A file called mkmf.log keeps
I have an app that uses copyrighted images that I have permission to use.
I have an app that uses the ActionBar with tabs in combination with Fragments.
I have an app that uses webView. In the home screen of a website
I have an app that uses a transition file to flip from page to
I have an app that uses the built-in flip animation to switch between the
I have an app that uses EF. To test my stuff I generally wrap
I have an app that uses the python/c api and I was wondering what
I have an app that uses a tableview, along with a UIButton that I
I have a App that uses the In App feature. -(void) completeTransaction: (skPaymenttransaction *)transaction{

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.