[ruby] my first scenario - Is this the best way ?

15 views
Skip to first unread message

roelof

unread,
Nov 2, 2012, 4:55:44 AM11/2/12
to cu...@googlegroups.com
Hello,
 
My end - goal is to write a website in RoR which has 2 parts.
A front end and a backend.
So I decided to write the backend on the BDD way.
In Ror you have a few gems which provides a full backend.
I'm thinking to use the activeadmin gem which provides authecation by using the devise gem.
My first scenario will be a user which logs into the backend.
 
Feature: a user login
 
    As a user wants to log into the backend he/she must be authencate
 
    Scenario :  when I wants to login
                       Then I have to be authenciate
                       I want to see the backend
 
Now I wonder if this is a good attempt because I have no clue how I can check if  I see the background in the acceptance and Rspec part.
 
Roelof
 
 

aslak hellesoy

unread,
Nov 2, 2012, 5:44:35 AM11/2/12
to Cucumber Users
On Fri, Nov 2, 2012 at 8:55 AM, roelof <rwo...@hotmail.com> wrote:
Hello,
 
My end - goal is to write a website in RoR which has 2 parts.
A front end and a backend.
So I decided to write the backend on the BDD way.
In Ror you have a few gems which provides a full backend.
I'm thinking to use the activeadmin gem which provides authecation by using the devise gem.
My first scenario will be a user which logs into the backend.
 
Feature: a user login
 
    As a user wants to log into the backend he/she must be authencate
 
    Scenario :  when I wants to login
                       Then I have to be authenciate
                       I want to see the backend
 

Pretend I'm your customer and I gave you these:

Scenario: log in as existing user
  Given a user "Aslak" exists
  When he logs in
  Then he should see "Welcome, Aslak"

Scenario: log in with bad password
  Given a user "Aslak" exists
  When he logs in with a bad password
  Then he should not see "Welcome, Aslak"
  And he should see "Login failed"

Run Cucumber and let it tell you what to do next.

Aslak
 
Could you implement the functional

Now I wonder if this is a good attempt because I have no clue how I can check if  I see the background in the acceptance and Rspec part.
 
Roelof
 
 

--
-- Rules --
 
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
 
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
 
 

Roelof Wobben

unread,
Nov 2, 2012, 7:29:15 AM11/2/12
to cu...@googlegroups.com

Thanks,

Finnaly I have cucumber and rspec working.
I will work on this example this afternoon and evening.
And if I get it finished then I would report the result back to you.

Roelof


From: aslak.h...@gmail.com
Date: Fri, 2 Nov 2012 09:44:35 +0000
Subject: Re: [Cucumber] [ruby] my first scenario - Is this the best way ?
To: cu...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages