Add current_user to Cucumber step definitions

Cucumber provides a great way to apply BDD during your rails development.

Sometimes you need to populate your testing database with background data and sometimes you need to access the

1
current_user

method.

Generally

1
current_user

is a method defined in the

1
ApplicationController

class or in a user related module.
So it’s not accessible to Cucumber’s scenarios: let’s add it and share to all step definition’s classes.

1
Specified file is not in uploads folder, does not exists, or not a file.

Tags: ,


About Stefano

Stefano Mancini is a co-founder of DevInterface.

After graduating in Computer Science, he first specialized in Java/J2EE development by participating in several international projects in the pharmaceutical and banking ambits.

Enthusiast of agile development, like SCRUM for project management and eXtreme Programming for code writing, he then moved to dynamic languages like Ruby and Python.

About DevInterface

We are an information and communication technology agency. Our mission is to provide web application development, design services and communication strategies. We specialize in building web applications with modern and efficient frameworks.

Random Posts

Leave a Reply

Insert code beetween <code lang="ruby"> and </code>

Copyright 2012 DevInterface s.n.c.

DevInterface Blog is proudly powered by WordPress