Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Am I on the right track
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  13 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
roelof  
View profile  
 More options Nov 2 2012, 11:44 am
From: roelof <rwob...@hotmail.com>
Date: Fri, 2 Nov 2012 08:44:28 -0700 (PDT)
Local: Fri, Nov 2 2012 11:44 am
Subject: Am I on the right track

Hello,

I making my first BDD site which you can find here :
https://github.com/roelof1967/tamara
Now the first test is failing with this message :

Given a user "Aslak" exists         #
features/step_definitions/login_steps.rb:1
    When he logs in                     #
features/step_definitions/login_steps.rb:4
      undefined method `[]' for nil:NilClass (NoMethodError)
      ./features/step_definitions/login_steps.rb:5:in `/^he logs in$/'
      features/login.feature:5:in `When he logs in'

Is this because I use @user.name or do I don't see the right reason ?

Roelof


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aslak hellesoy  
View profile  
 More options Nov 2 2012, 1:20 pm
From: aslak hellesoy <aslak.helle...@gmail.com>
Date: Fri, 2 Nov 2012 17:19:55 +0000
Local: Fri, Nov 2 2012 1:19 pm
Subject: Re: [Cucumber] Am I on the right track

On Fri, Nov 2, 2012 at 3:44 PM, roelof <rwob...@hotmail.com> wrote:
> Hello,

> I making my first BDD site which you can find here :
> https://github.com/roelof1967/tamara
> Now the first test is failing with this message :

See https://github.com/roelof1967/tamara/pull/1

The comment in snippets is there for a reason (pending # express the regexp
above with the code you wish you had)

Instead of leaving the Given stepdef blank you should have written some
code here. Since you didn't you got confused at a later stage - in the When
step.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
roelof  
View profile  
 More options Nov 2 2012, 2:30 pm
From: roelof <rwob...@hotmail.com>
Date: Fri, 2 Nov 2012 11:30:53 -0700 (PDT)
Local: Fri, Nov 2 2012 2:30 pm
Subject: Re: [Cucumber] Am I on the right track

One thing I don't understand. Why create a new user ?
In my opinion a existing user is a user which is already in the database
and in the user model so a existing user is already created.
Roelof

Op vrijdag 2 november 2012 18:20:18 UTC+1 schreef Aslak Hellesøy het
volgende:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
George Dinwiddie  
View profile  
 More options Nov 2 2012, 3:21 pm
From: George Dinwiddie <li...@iDIAcomputing.com>
Date: Fri, 02 Nov 2012 15:21:53 -0400
Local: Fri, Nov 2 2012 3:21 pm
Subject: Re: [Cucumber] Am I on the right track
Roelof,

On 11/2/12 2:30 PM, roelof wrote:

> One thing I don't understand. Why create a new user ?
> In my opinion a existing user is a user which is already in the database
> and in the user model so a existing user is already created.

You have never initialized the @user variable. Since it's nil, you can't
call any methods on it.

  - George

P.S. Please use interleaved answers
      http://en.wikipedia.org/wiki/Posting_style#Interleaved_style

--
  ----------------------------------------------------------------------
   * George Dinwiddie *                      http://blog.gdinwiddie.com
   Software Development                    http://www.idiacomputing.com
   Consultant and Coach                    http://www.agilemaryland.org
  ----------------------------------------------------------------------

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
roelof  
View profile  
 More options Nov 3 2012, 4:09 am
From: roelof <rwob...@hotmail.com>
Date: Sat, 3 Nov 2012 01:09:27 -0700 (PDT)
Local: Sat, Nov 3 2012 4:09 am
Subject: Re: [Cucumber] Am I on the right track

Thanks,

I now get this message:

Scenario: log in as existing user     # features/login.feature:3
    Given a user "Aslak" exists         #
features/step_definitions/login_steps.rb:5
      unknown attribute: name (ActiveRecord::UnknownAttributeError)
      ./features/step_definitions/login_steps.rb:6:in `/^a user "(.*?)"
exists$/'
      features/login.feature:4:in `Given a user "Aslak" exists'

Must I now write my spec files or must I change something in my
step-defenitions to solve this problem.

Roelof

Op vrijdag 2 november 2012 20:21:58 UTC+1 schreef George Dinwiddie het
volgende:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
roelof  
View profile  
 More options Nov 3 2012, 5:07 am
From: roelof <rwob...@hotmail.com>
Date: Sat, 3 Nov 2012 02:07:18 -0700 (PDT)
Local: Sat, Nov 3 2012 5:07 am
Subject: Re: [Cucumber] Am I on the right track

I solved this one with chancing the class definition to this :

class User < ActiveRecord::Base
  attr_accessible :name, :password

  def initialize
    @name = name
    @password = password
  end

end

But now I see this message:

Given a user "Aslak" exists         #
features/step_definitions/login_steps.rb:10
      wrong number of arguments (2 for 0) (ArgumentError)
      ./features/step_definitions/login_steps.rb:4:in `initialize'
      ./features/step_definitions/login_steps.rb:11:in `/^a user "(.*?)"
exists$/'
      features/login.feature:4:in `Given a user "Aslak" exists'

Roelof

Op zaterdag 3 november 2012 09:09:27 UTC+1 schreef roelof het volgende:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vicenzo Naves  
View profile  
 More options Nov 3 2012, 7:05 am
From: Vicenzo Naves <vice...@gmail.com>
Date: Sat, 3 Nov 2012 09:05:28 -0200
Local: Sat, Nov 3 2012 7:05 am
Subject: Re: [Cucumber] Am I on the right track

Vicenzo Naves

Sent from my iPhone
+55 (31)9996-6915

On 03/11/2012, at 07:07, roelof <rwob...@hotmail.com> wrote:

How your step def looks like?
You are trying to reach a record with 2 arguments where you dont need any.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roelof Wobben  
View profile  
 More options Nov 3 2012, 7:24 am
From: Roelof Wobben <rwob...@hotmail.com>
Date: Sat, 3 Nov 2012 11:24:20 +0000
Local: Sat, Nov 3 2012 7:24 am
Subject: RE: [Cucumber] Am I on the right track

 Hello,  My steps definition looks like this :    Subject: Re: [Cucumber] Am I on the right track
From: vice...@gmail.com
Date: Sat, 3 Nov 2012 09:05:28 -0200
To: cukes@googlegroups.com

Vicenzo Naves
Sent from my iPhone+55 (31)9996-6915
On 03/11/2012, at 07:07, roelof <rwob...@hotmail.com> wrote:

I solved this one with chancing the class definition to this :

class User < ActiveRecord::Base
  attr_accessible :name, :password

  def initialize
    @name = name
    @password = password
  end

end

But now I see this message:

Given a user "Aslak" exists         # features/step_definitions/login_steps.rb:10
      wrong number of arguments (2 for 0) (ArgumentError)
      ./features/step_definitions/login_steps.rb:4:in `initialize'
      ./features/step_definitions/login_steps.rb:11:in `/^a user "(.*?)" exists$/'
      features/login.feature:4:in `Given a user "Aslak" exists'

Roelof

How your step def looks like?You are trying to reach a record with 2 arguments where you dont need any. It's look like this : class User < ActiveRecord::Base  attr_accessible :name, :password    def initialize     @name = name    @password = password  end  end
Given /^a user "(.*?)" exists$/ do |user_name|  @user = User.create!(:name => user_name, :password => "s3cr3t")end
When /^he logs in$/ do  visit("/users/sign_in")  fill_in('User name', :with => @user.name)  fill_in('Password', :with => @user.password)  click_button('Log in')end
Then /^he should see "(.*?)"$/ do  pending # express the regexp above with the code you wish you hadend
When /^he logs in with a bad password$/ do  pending # express the regexp above with the code you wish you hadend
Then /^he should not see "(.*?)"$/ do |arg1|  pending # express the regexp above with the code you wish you hadend  Roelof

Op zaterdag 3 november 2012 09:09:27 UTC+1 schreef roelof het volgende:Thanks,

I now get this message:

Scenario: log in as existing user     # features/login.feature:3
    Given a user "Aslak" exists         # features/step_definitions/login_steps.rb:5
      unknown attribute: name (ActiveRecord::UnknownAttributeError)
      ./features/step_definitions/login_steps.rb:6:in `/^a user "(.*?)" exists$/'
      features/login.feature:4:in `Given a user "Aslak" exists'

Must I now write my spec files or must I change something in my step-defenitions to solve this problem.

Roelof

Op vrijdag 2 november 2012 20:21:58 UTC+1 schreef George Dinwiddie het volgende:Roelof,

On 11/2/12 2:30 PM, roelof wrote:

> One thing I don't understand. Why create a new user ?
> In my opinion a existing user is a user which is already in the database
> and in the user model so a existing user is already created.

You have never initialized the @user variable. Since it's nil, you can't

call any methods on it.

  - George

P.S. Please use interleaved answers

      http://en.wikipedia.org/wiki/Posting_style#Interleaved_style

--

  ----------------------------------------------------------------------

   * George Dinwiddie *                      http://blog.gdinwiddie.com

   Software Development                    http://www.idiacomputing.com

   Consultant and Coach                    http://www.agilemaryland.org

  ----------------------------------------------------------------------

--

-- 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 cukes@googlegroups.com. To unsubscribe from this group, send email to cukes+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en

--

-- 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 cukes@googlegroups.com. To unsubscribe from this group, send email to cukes+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Vicenzo Naves  
View profile  
 More options Nov 3 2012, 7:29 am
From: Vicenzo Naves <vice...@gmail.com>
Date: Sat, 3 Nov 2012 09:28:54 -0200
Local: Sat, Nov 3 2012 7:28 am
Subject: Re: [Cucumber] Am I on the right track

How your step def looks like?
You are trying to reach a record with 2 arguments where you dont need any.

It's look like this :

class User < ActiveRecord::Base
attr_accessible :name, :password
def initialize
@name = name
@password = password
end
end

Given /^a user "(.*?)" exists$/ do |user_name|
@user = User.create!(:name => user_name, :password => "s3cr3t")
end

When /^he logs in$/ do
visit("/users/sign_in")
fill_in('User name', :with => @user.name)
fill_in('Password', :with => @user.password)
click_button('Log in')
end

Then /^he should see "(.*?)"$/ do
pending # express the regexp above with the code you wish you had
end

When /^he logs in with a bad password$/ do
pending # express the regexp above with the code you wish you had
end

Then /^he should not see "(.*?)"$/ do |arg1|
pending # express the regexp above with the code you wish you had
end

Then the problem is with the model.
I believe you are using RoR.

The model is created with scaffolding, they have the basic for what you
want.

The thing is, you have to have the controller for be able to access it.

def create
  User.new(:params)
end

something like that...

--
Vicenzo Naves
ISTQB CTFL Certified
Analista de Testes
(31) 9996-6915
www.geekcuisine.com.br

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aslak hellesoy  
View profile  
 More options Nov 3 2012, 7:39 am
From: aslak hellesoy <aslak.helle...@gmail.com>
Date: Sat, 3 Nov 2012 11:39:03 +0000
Local: Sat, Nov 3 2012 7:39 am
Subject: Re: [Cucumber] Am I on the right track

On Sat, Nov 3, 2012 at 9:07 AM, roelof <rwob...@hotmail.com> wrote:
> I solved this one with chancing the class definition to this :

> class User < ActiveRecord::Base
>   attr_accessible :name, :password

>   def initialize
>     @name = name
>     @password = password
>   end

> end

May I suggest you study Ruby on Rails before you continue any further? This
is not how you create attributes on an activerecord class. It's done by
adding columns to its table. You have to add a migration.

It seems like you're new to more than just Cucumber, and that makes it a
little tricky to use a forum like this. We want to stay focussed on
Cucumber here.

Aslak

But now I see this message:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
roelof  
View profile  
 More options Nov 3 2012, 8:57 am
From: roelof <rwob...@hotmail.com>
Date: Sat, 3 Nov 2012 05:57:40 -0700 (PDT)
Local: Sat, Nov 3 2012 8:57 am
Subject: Re: [Cucumber] Am I on the right track

Your right.
Im new to Cucumber and Ruby. I tought I had learned Ruby from codeschool
but appearently I don know enough

I was just asking about a new problem but maybe I can better ask on the
Ruby Forum,

I now see these  messages :

When he logs in                             #
features/step_definitions/login_steps.rb:5
      undefined method `[]' for nil:NilClass (NoMethodError)
      ./features/step_definitions/login_steps.rb:6:in `/^he logs in$/'
      features/login.feature:5:in `When he logs in'

I changed the scenario because the devise gem is using a email adress
instead of a name.
But appearently I missed something.
II wonder if this is too hard material to learn without a teacher and learn
this from a book myself.

Roelof

Op zaterdag 3 november 2012 12:39:28 UTC+1 schreef Aslak Hellesøy het
volgende:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
aslak hellesoy  
View profile  
 More options Nov 3 2012, 9:09 am
From: aslak hellesoy <aslak.helle...@gmail.com>
Date: Sat, 3 Nov 2012 13:09:17 +0000
Local: Sat, Nov 3 2012 9:09 am
Subject: Re: [Cucumber] Am I on the right track

On Sat, Nov 3, 2012 at 12:57 PM, roelof <rwob...@hotmail.com> wrote:
> Your right.
> Im new to Cucumber and Ruby. I tought I had learned Ruby from codeschool
> but appearently I don know enough

Ruby (the programming language) is not the same as Ruby on Rails (the web
framework written in Ruby).

Rails is a pretty big framework and I'd definitely pick up a book teaching
it. Some Rails books might try to teach you Ruby as well, but it might be
useful to pick up a (non-Rails) Ruby book as well.

And of course - the Cucumber book!

Aslak


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
roelof  
View profile  
 More options Nov 16 2012, 2:33 am
From: roelof <rwob...@hotmail.com>
Date: Thu, 15 Nov 2012 23:33:42 -0800 (PST)
Local: Fri, Nov 16 2012 2:33 am
Subject: Re: Am I on the right track

Hello Aslak,

Everything is working. See this git repo :
https://github.com/roelof1967/tamara

Roelof

Op vrijdag 2 november 2012 16:44:28 UTC+1 schreef roelof het volgende:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »