Re: [rspec] beginner in tests RSpec $RSpec --help_me_please

18 views
Skip to first unread message

Antonio Antillon

unread,
Jan 27, 2013, 5:08:27 AM1/27/13
to rs...@googlegroups.com

Hey Nicolas,

Looks like you may be wiring rspec into a rails app.

If so, please note that your specs should live inside the spec directory in your rails root directory, and mostly mirrors the same structure of your app directory.

I am including this link to a sample gist based on your example. https://gist.github.com/4647648

Please note that I provide the full path for this sample file.

Hope this helps.

On Jan 26, 2013 10:23 PM, "Nicolás Sebastián Vidal" <nicolas...@gmail.com> wrote:
Hi all, i did the guide of rails 3.2 and when a finish it, i want to implement test for this guide, so i readed about RSpec.

But i can't understand how to implement it.

I try to do this.

#app/spec/post_spec.rb

require 'spec_helper'
require 'post'
require 'debugger'

describe "Analyze that the attributes can't be nil." do

  before(:all) do
    @post=Post.new
  end

  it "trying that works" do   
    @post.title= 'im not nil'
    @post.name= 'im not nil'
    @post.content='im not nil'
    @post.save.should be_true
  end
end

Can any help me to understand how RSpec works.

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To post to this group, send email to rs...@googlegroups.com.
To unsubscribe from this group, send email to rspec+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rspec/-/cdWP5GdM7BAJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Nicolás Sebastián Vidal

unread,
Jan 28, 2013, 6:36:23 AM1/28/13
to rs...@googlegroups.com
Thak you!!!!!!!!

Nicolás Sebastián Vidal

unread,
Jan 28, 2013, 7:51:29 AM1/28/13
to rs...@googlegroups.com
thanks for your example  https://gist.github.com/4647648....i did a comment...


El domingo, 27 de enero de 2013 07:08:27 UTC-3, Antonio escribió:

Hey Nicolas,

Looks like you may be wiring rspec into a rails app.

If so, please note that your specs should live inside the spec directory in your rails root directory, and mostly mirrors the same structure of your app directory.

I am including this link to a sample gist based on your example. https://gisat.github.com/4647648

Reply all
Reply to author
Forward
0 new messages