-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi Chris,
On Oct 26, 2010, at 11:15 AM, Chris Mear wrote:
>
> On 25 Oct 2010, at 09:54, Haim Ashkenazi wrote:
>
>> On Oct 25, 2010, at 9:09 AM, Haim Ashkenazi wrote:
>>
>>> Hi
>>>
>>> This is my first ruby script, so sorry if it's trivial :)
>>>
On 25 Oct 2010, at 09:54, Haim Ashkenazi wrote:
> On Oct 25, 2010, at 9:09 AM, Haim Ashkenazi wrote:
>
>> Hi
>>
>> This is my first ruby script, so sorry if it's trivial :)
>>
>> I have a should_receive expectation on :new which should work (and works on
>> a simple test I wrote) but it doesn
Hi
I'm not sure if the URLs in the original post can be viewed :( so here they are:
The repository is here: http://github.com/babysnakes/runssh
The spec with the problem is
http://github.com/babysnakes/runssh/blob/5197b763f391d6d358ca7bc5838375c9247271d8/spec/runsshlib/cli_spec.rb
(line 127).
Hi
This is my first ruby script, so sorry if it's trivial :)
I have a should_receive expectation on :new which should work (and works on a
simple test I wrote) but it doesn't work in my case and I can't figure out why.
The source is on github (commit: 5197b763f391d6d358ca7bc5838375c9247271d8).
Finally solved the problem. Even though the application is Rails
2.3.5 it was started on a much earlier version and the view files were
using the old rhtml extensions. The newer auto format detection uses
html.erb, or in the case of the mailer, likes
file_name.text.html.erb. All I had to do was
Dave
Thanks for looking at this. I really appreciate it.
Here is the method being called:
144 # Sign up a new user with a default role of USER and with a state
of pending.
145 # The user must activate their account via e-mail before they can
login
146 def self.create_from_signup(params = {} )
On Wed, Dec 9, 2009 at 7:48 PM, Brad wrote:
> No one was able to help me with the last post so I thought I would try
> again with more details. I am having problems with specs that invoke
> the mailer. My User model has a method that invokes a mailer as part
> of the create_from_signup method.
>
No one was able to help me with the last post so I thought I would try
again with more details. I am having problems with specs that invoke
the mailer. My User model has a method that invokes a mailer as part
of the create_from_signup method.
First an example of the test that passes in my spec/m
On Wed, Oct 7, 2009 at 4:18 PM, Andrew Premdas wrote:
> 2009/10/7 David Chelimsky
>>
>> On Wed, Oct 7, 2009 at 3:57 PM, aslak hellesoy
>> wrote:
>> >
>> >
>> > On Wed, Oct 7, 2009 at 10:24 PM, Andrew Premdas
>> > wrote:
>> >>
>> >> 2009/9/25 Mithun Perera
>> >>>
>> >>> Mithun Perera wrote:
>>
2009/10/7 David Chelimsky
> On Wed, Oct 7, 2009 at 3:57 PM, aslak hellesoy
> wrote:
> >
> >
> > On Wed, Oct 7, 2009 at 10:24 PM, Andrew Premdas
> wrote:
> >>
> >> 2009/9/25 Mithun Perera
> >>>
> >>> Mithun Perera wrote:
> >>> > Mithun Perera wrote:
> >>> >> Hi all,
> >>> >> I am an university
2009/10/7 aslak hellesoy
>
>
> On Wed, Oct 7, 2009 at 10:24 PM, Andrew Premdas wrote:
>
>> 2009/9/25 Mithun Perera
>>
>>> Mithun Perera wrote:
>>> > Mithun Perera wrote:
>>> >> Hi all,
>>> >> I am an university student and these days i am on training period. So
>>> i
>>> >> want to know about ru
On Wed, Oct 7, 2009 at 3:57 PM, aslak hellesoy wrote:
>
>
> On Wed, Oct 7, 2009 at 10:24 PM, Andrew Premdas wrote:
>>
>> 2009/9/25 Mithun Perera
>>>
>>> Mithun Perera wrote:
>>> > Mithun Perera wrote:
>>> >> Hi all,
>>> >> I am an university student and these days i am on training period. So
>>>
On Wed, Oct 7, 2009 at 10:24 PM, Andrew Premdas wrote:
> 2009/9/25 Mithun Perera
>
>> Mithun Perera wrote:
>> > Mithun Perera wrote:
>> >> Hi all,
>> >> I am an university student and these days i am on training period. So i
>> >> want to know about ruby on on rails "cucumber and Rspec". If some
2009/9/25 Mithun Perera
> Mithun Perera wrote:
> > Mithun Perera wrote:
> >> Hi all,
> >> I am an university student and these days i am on training period. So i
> >> want to know about ruby on on rails "cucumber and Rspec". If somebody
> >> know about these fields please help me. If not please s
On 25 Sep 2009, at 08:07, Mithun Perera wrote:
Mithun Perera wrote:
Mithun Perera wrote:
Hi all,
I am an university student and these days i am on training period.
So i
want to know about ruby on on rails "cucumber and Rspec". If
somebody
know about these fields please help me. If not pl
Mithun Perera wrote:
> Mithun Perera wrote:
>> Hi all,
>> I am an university student and these days i am on training period. So i
>> want to know about ruby on on rails "cucumber and Rspec". If somebody
>> know about these fields please help me. If not please send me an
>> tutorials for basic funct
On 22 Sep 2009, at 06:34, Mithun Perera wrote:
Mithun Perera wrote:
Hi all,
I am an university student and these days i am on training period.
So i
want to know about ruby on on rails "cucumber and Rspec". If somebody
know about these fields please help me. If not please send me an
tutorial
Mithun Perera wrote:
> Hi all,
> I am an university student and these days i am on training period. So i
> want to know about ruby on on rails "cucumber and Rspec". If somebody
> know about these fields please help me. If not please send me an
> tutorials for basic functionality of the cucumber and
If you want a quick intro it's worth looking on http://www.slideshare.net/
for some intro talks at the many Rails conventions that have been held
recently. Try searching for cucumber or rspec and see what falls out.
There are videos of presentations out there too, for example
http://www.engineyard
If you go to peepcode.com, they have some excellent resources on RSpec &
Cucumber, and there is always The RSpec Book (from the pragmatic
programmers).HTH,
Doug.
2009/9/21 Mithun Perera
> Hi all,
> I am an university student and these days i am on training period. So i
> want to know about ru
Hi all,
I am an university student and these days i am on training period. So i
want to know about ruby on on rails "cucumber and Rspec". If somebody
know about these fields please help me. If not please send me an
tutorials for basic functionality of the cucumber and Rspec.
Thank you.
regards,
Mit
On Fri, Oct 10, 2008 at 9:37 AM, Christopher Bailey
<[EMAIL PROTECTED]> wrote:
> I've moved on from this with a bit different approach. But, I also found
> that the "get" (or whichever http method used) call expects the first
> parameter to be an action, so passing in a string that is a path or UR
I've moved on from this with a bit different approach. But, I also found
that the "get" (or whichever http method used) call expects the first
parameter to be an action, so passing in a string that is a path or URL
doesn't work for that.
On Fri, Oct 10, 2008 at 1:04 AM, Matt Wynne <[EMAIL PROTECT
On 9 Oct 2008, at 20:24, Christopher Bailey wrote:
I have a controller test, where I want to do a GET on a page. Our
URL's are complex, and need to be correct (duh, but we allow some
slop, but that causes a redirect which I want to avoid). Anyway, in
my controller test I do a get to the
I have a controller test, where I want to do a GET on a page. Our URL's are
complex, and need to be correct (duh, but we allow some slop, but that
causes a redirect which I want to avoid). Anyway, in my controller test I
do a get to the URL that is produced by a helper method which calls a named
I have a resource_security.rb file that includes instance and class
method definitions. At the end of the file I mix these into
ActiveRecord::Base.
ActiveRecord::Base.class_eval { include ResourceSecurity::InstanceMethods }
ActiveRecord::Base.class_eval { extend ResourceSecurity::ClassMethods }
On Dec 16, 2007 1:43 PM, David Chelimsky <[EMAIL PROTECTED]> wrote:
> I tend to take this one more step. I'm a bit of a demeter zealot, and
> I'm also usually writing the examples from the code first. So I'd do
> something like:
>
> it "should find the current users articles" do
> article = mock_
On Dec 16, 2007 4:01 PM, Daniel N <[EMAIL PROTECTED]> wrote:
>
>
>
> On Dec 17, 2007 8:43 AM, David Chelimsky <[EMAIL PROTECTED]> wrote:
> >
> > On Dec 16, 2007 11:03 AM, Jonathan Linowes <[EMAIL PROTECTED]>
> wrote:
> > >
> > > btw, to answer the same question for member actions (such as show), yo
On Dec 17, 2007 8:43 AM, David Chelimsky <[EMAIL PROTECTED]> wrote:
> On Dec 16, 2007 11:03 AM, Jonathan Linowes <[EMAIL PROTECTED]>
> wrote:
> >
> > btw, to answer the same question for member actions (such as show), you
> can
> > stub or assert the association proxy class
> >
> > @article = cur
On Dec 16, 2007 11:03 AM, Jonathan Linowes <[EMAIL PROTECTED]> wrote:
>
> btw, to answer the same question for member actions (such as show), you can
> stub or assert the association proxy class
>
> @article = current_user.articles.find(params[:id])
>
> then,
>
> it "should find article scoped by
btw, to answer the same question for member actions (such as show),
you can stub or assert the association proxy class
@article = current_user.articles.find(params[:id])
then,
it "should find article scoped by current_user" do
article = mock_model(Article)
current_user
On 4.12.2007, at 8.40, Fischer, Daniel wrote:
> Sorry for so many messages, I hope I don't get in trouble for this.
> Maybe IRC would be better if there was a RSpec one.
#rspec @freenode
//jarkko
--
Jarkko Laine
http://jlaine.net
http://dotherightthing.com
http://www.railsecommerce.com
http:
Sorry for so many messages, I hope I don't get in trouble for this. Maybe
IRC would be better if there was a RSpec one.
Anyway, the previous problem was solved with the following
http://pastie.textmate.org/private/m6qqfd7tzeanw2yar8rua
The problem was caused by :
@user = mock_model(User, :wri
Alright, thanks, I'm getting more progress in this. As soon as I figure this
out I won't have too many problems.. hopefully.
Anyone know what "undefined method `call' for "1":String" means?
I'm trying to do this:
http://pastie.textmate.org/private/17jjjmbave0ph2mkcgp6w
On Dec 3, 2007 9:33 PM, D
On Dec 3, 2007 10:26 PM, Fischer, Daniel <[EMAIL PROTECTED]> wrote:
> Hey cool, thanks for the help guys. One problem though, when I take this
> approach I can't decouple the specs anymore. They all "User_xxx receive
> unexpected message :articles". It seems silly to include all behaviors in
> one
I also have another problem, when I am trying to do the similar strategy for
XML based speccing it fails on saying nil.to_xml
Arg..
And all it is, is the following => (with a before_filter on login required)
but still, it's just current_user.
def show
@writing = current_user.writings.find(p
Hey cool, thanks for the help guys. One problem though, when I take this
approach I can't decouple the specs anymore. They all "User_xxx receive
unexpected message :articles". It seems silly to include all behaviors in
one spec, or put that expectation in each test. Is there a way around this?
Than
Well, if articles is already scoped, you just say:
user.should_receive('articles').and_return(some_articles)
To make sure your articles method is scoped, write a model test that hits
the database, and verify that only the user's articles are returned.
As Daniel Tenner says, you should try to kee
Hi Daniel,
You're trying to do too much in the controller. It's not the
controller's responsibility to ensure that the user is capable of
returning its own article without including anyone else's - that's
the user's (or the Article model's, perhaps) responsibility. Your
controller should
Assuming that there is a call like this in your controller
@articles = current_user.articles
One way to do this is to stub out the controller.current_user to return a
mock object of the current_user
Then put an expectation on the current user that it's articles method gets
called. (return a mocke
On 3.12.2007, at 11.57, Fischer, Daniel wrote:
> Let's say you're using the restful_authentication plugin.
>
> You have a model called articles. On the index action of the
> articlescontroller you simply want to spec out that it'll scope the
> results to the ownership of the current_user.
>
>
yuck, that seems kind of nasty, no?
user.articles is already scoped...
There has to be a different solution!
On Dec 3, 2007 2:07 AM, Stefan Magnus Landrø <[EMAIL PROTECTED]>
wrote:
> Typically, I'd write a method in your user model that returns the user's
> articles:
>
> class User do
>
> def
Typically, I'd write a method in your user model that returns the user's
articles:
class User do
def find_articles_for_user
Article.find(:all, :conditions => ['userid = ?', id)
end
end
Then you'd use a mock in your controller spec, and make sure you test that
your method is being called.
Let's say you're using the restful_authentication plugin.
You have a model called articles. On the index action of the
articlescontroller you simply want to spec out that it'll scope the results
to the ownership of the current_user.
It should NOT include any articles other than the articles that u
Let's say you're using the restful_authentication plugin.
You have a model called articles. On the index action of the
articlescontroller you simply want to spec out that it'll scope the results
to the ownership of the current_user.
It should NOT include any articles other than the articles that u
On 9/13/07, Shaker <[EMAIL PROTECTED]> wrote:
>
> Sorry, that's another spec caused the error. It is working. Thank you very
> much
Glad you got it worked out.
Cheers,
David
>
> Shaker wrote:
> >
> > Hello
> > To spec the example I mentioned before, I wrote the spec as what you
> > suggested
>
Sorry, that's another spec caused the error. It is working. Thank you very
much
Shaker wrote:
>
> Hello
> To spec the example I mentioned before, I wrote the spec as what you
> suggested
> #../view/group/index_spec.rb
> describe "/group/_index_spec" do
> it "should call JS function when
Hello
To spec the example I mentioned before, I wrote the spec as what you
suggested
#../view/group/index_spec.rb
describe "/group/_index_spec" do
it "should call JS function when click the button" do
render '/group/_index'
response.should have_tag("input[onclick=?]", "update()
On 9/13/07, Shaker <[EMAIL PROTECTED]> wrote:
>
> Yes, I have gone through the documentation before, and I read the reference
> of 'assert_select' as well. But I still can not figure out a way of testing
> attributes in a tag. What I know is we can use:
> should have_tag("tag#id") or should have_
Yes, I have gone through the documentation before, and I read the reference
of 'assert_select' as well. But I still can not figure out a way of testing
attributes in a tag. What I know is we can use:
should have_tag("tag#id") or should have_tag("tag.class")
to select a tag, whereas I don't know
On 9/13/07, Shaker <[EMAIL PROTECTED]> wrote:
> I can not find much
> information about the "should have_tag" syntax in Rspec.
http://rspec.rubyforge.org/rdoc-rails/classes/Spec/Rails/Matchers.html#M11
___
rspec-users mailing list
rspec-users@rubyfor
Hello everyone:
I am kind of puzzled in writing spec on view partials. I can not find much
information about the "should have_tag" syntax in Rspec. Can rspec test a
particular attribute of a tag (e.g. input tag)? Let me put an example here:
#../view/group/_index
I want to test the "on
I like the it "should..." do end calls, specifiy as well makes sense.
So what is the problem? I think we should take a look at what comments are for.
Essentially the "should blah" text acts as a comment on the spec. One
that is then picked up by RSpec and inserted to make our
specifications mor
Well in that specific case, please seems like a good choice
please do
@thing.should be_somthing
end
But If you had text in between then it wouldn't seem the same:
please "whatever text" do
@thing.should be_something
end
Quoting David Chelimsky <[EMAIL PROTECTED]>:
> H
On 7/19/07, David Chelimsky <[EMAIL PROTECTED]> wrote:
Hey all,
I see examples showing up that look like this:
describe Thing do
before(:each) do
@thing = Thing.new
end
it do
@thing.should be_something
end
end
This will produce output like this:
Thing
- should be something
David Chelimsky wrote:
> Consise? Yes. But I'm not psyched about 'specify' either. There IS a
> perfect word for this situation. What is it? Suggestions?
Personally, I disagree. For examples like that, I think 'specify' is a
pretty ideal word. It reads exactly as I want it to. Depending on what
On 7/19/07, David Chelimsky <[EMAIL PROTECTED]> wrote:
Hey all,
I see examples showing up that look like this:
describe Thing do
before(:each) do
@thing = Thing.new
end
it do
@thing.should be_something
end
end
This will produce output like this:
Thing
- should be something
Hey all,
I see examples showing up that look like this:
describe Thing do
before(:each) do
@thing = Thing.new
end
it do
@thing.should be_something
end
end
This will produce output like this:
Thing
- should be something
But "it do" is driving me mad :(
We need a better word. O
58 matches
Mail list logo