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 3623398
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:22:42+00:00 2026-05-18T23:22:42+00:00

What I what to accomplish is to use (rely on) current_user method while defining

  • 0

What I what to accomplish is to use (rely on) current_user method while defining Cucumber steps. I’m using Clearance in my project.

First of all I tried to use sign_in but it didn’t work (I guess Cucumber World doesn’t know about Clearance methods…).

So how do I make Cuckes recognize current_user and sign_in/sign_out methods?

  • 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-05-18T23:22:43+00:00Added an answer on May 18, 2026 at 11:22 pm

    Your Cucumber features should be driving your application through the public user interface. Something like:

    Given /^I am signed in as "([^\"]*)"%/ do |username|
      visit 'sign_in'
      fill_in 'Username', :with => username
      click 'Sign In'
    end
    

    Since the current_user method isn’t available to the browser, you shouldn’t be using it in your spec.

    You could fake it in your steps by storing @current_user in the above step and then providing an attribute reader for it.

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

Sidebar

Related Questions

First all, I am still learning CakePHP and I am close to ZERO using
I'm wondering how one could use template databinding to accomplish what the following code
I'm really struggling with grasping how to effectively use FasterCSV to accomplish what I
I'd like to accomplish something like this: Call a method, say turn, and then
I'm getting ready to dive into my first Core Data adventure. While evaluating the
I'm having trouble on what pattern I should use to accomplish this class DateTimeReference
What language feature or outside-the-box hack can I use to accomplish function inlining in
I have an entity in EF called Registry that I use for throwing all
Is there a common Javascript/Coffeescript-specific idiom I can use to accomplish this? Mainly out
How would I accomplish displaying a line as the one below in a console

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.