Testing a signup form with Bacon

25 views
Skip to first unread message

desbest

unread,
Oct 2, 2012, 2:51:05 PM10/2/12
to ram...@googlegroups.com
Hey I'm trying to test whether a registration form works using Bacon, rather than me try it out myself, and I'm having trouble knowing what I'm supposed to put in.

The output of my test says 

 
Person
- should be able to register [ERROR: NoMethodError]

And I'm using this code.

  describe 'Person' do
    should 'be able to register' do
      post("/makenew/signup",
      'username' => 'stranger',
      'password' => 'blahblahblah',
      'cpass' => 'blahblahblah',
      'email' => 'donot...@google.com').status.should == 200
    end
  end

I'm not exactly sure what method I'm omitting, considering it's a No Method error.

I just know that Bacon isn't executing my test for some reason.

desbest

unread,
Oct 29, 2012, 4:37:06 PM10/29/12
to ram...@googlegroups.com
bump!

360R8

unread,
Oct 30, 2012, 10:09:24 AM10/30/12
to ram...@googlegroups.com
May be you will have more luck asking your question in the bacon group?

desbest

unread,
Nov 13, 2012, 8:14:21 AM11/13/12
to ram...@googlegroups.com
I've been in touch with the person who made Bacon, and they cannot help me as they're saying that I maybe need to include or extend things to get methods.
 
I'm having problems running Bacon tests for some reason.
Take a look at this.
 

Yorick Peterse

unread,
Nov 13, 2012, 8:58:02 AM11/13/12
to ram...@googlegroups.com
Desbest,

If you're using a sane Ruby setup it should show you stack traces along
with the name of the non existing method. Seeing how your gist doesn't
contain it it's either cut out, which makes the stack trace useless, or
it never was there. In case of the latter you might want to make sure
that your Ruby installation is properly set up.

It's just a guess but I'm thinking the calls to `last_response[]` might
be the ones that are breaking. Give the following a try:

should 'show start page' do
response = get('/')

get.status.should == 200

# I'm not entirely sure if `headers` is the right method name,
# you should verify this yourself first.
get.headers['Content-Type'].should == 'text/html'

# ...
end

I'd also recommend giving Linux (or another Unix based system) a try to
see how it works on such a setup. Windows isn't a very decent platform
to develop Ruby projects on since they are almost always deployed to
Unix based systems.

Another thing I'd like to ask: while the mailing list is of course meant
for asking questions it's probably better to ask small questions on IRC.
In that past you've changed topics quite a few times in the same thread
and while there's no rule against it it does make it a lot harder to
keep track of things. The IRC channel is #ramaze on Freenode, if you
don't have an IRC client you can use the web interface:
http://webchat.freenode.net/

Yorick
Reply all
Reply to author
Forward
0 new messages