Re: [rspec-users] before(:all) to set up mocks and stubs

2010-07-15 Thread Ivo Dancet
gende geschreven: > On Jul 13, 2010, at 7:25 AM, Ivo Dancet wrote: > >> Hi >> >> I'm upgrading an application to rspec2/rails3. A certain suite of tests, >> that generates a pdf document, uses a before(:all) filter to set the >> environment using mocks an

[rspec-users] before(:all) to set up mocks and stubs

2010-07-13 Thread Ivo Dancet
Hi I'm upgrading an application to rspec2/rails3. A certain suite of tests, that generates a pdf document, uses a before(:all) filter to set the environment using mocks and stubs. Then the pdf gets generated and after that all the tests run on that same pdf document. In rspec2 it seems like I c

Re: [rspec-users] [ANN] rSquery 0.1.1

2009-05-16 Thread Ivo Dancet
n... http://google-opensource.blogspot.com/2009/05/introducing-webdriver.html It won't work right out of the box as it uses selenium in the end. It should however be quite easy to rewrite the two commands that access selenium directly if WebDriver makes it possible to execute js in the

[rspec-users] [ANN] rSquery 0.1.1

2009-05-15 Thread Ivo Dancet
dialog div").text.should have_text(/some_text/) - jquery("#dialog").find(".warning") - jquery("#dialog").html.should have_tag("button", "Ok") - jquery("#dialog").should be_visible - jquery("#dialog") # page m

Re: [rspec-users] Problem with testing helper

2008-12-30 Thread Ivo Dancet
Done: http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/641-form-tag-helpers-in-helpers Regards -c Op 30-dec-08, om 16:41 heeft David Chelimsky het volgende geschreven: On Tue, Dec 30, 2008 at 9:14 AM, Ivo Dancet > wrote: Hi I bumped into a problem and tracked it down to t

[rspec-users] Problem with testing helper

2008-12-30 Thread Ivo Dancet
Hi I bumped into a problem and tracked it down to this: Form tag helpers in helpers do not seem to be testable. The helper does actually work like it should if used in a view. Example: This helper: # def form_builder form_tag "foo" do text_field_tag("bar") end end And

Re: [rspec-users] Stubbing class in controller

2008-04-19 Thread Ivo Dancet
Hi The 'loadavg' method is an instance method of 'whm', so the test should be: @whm = mock_model(Whm::Client) Whm::Client.stub!(:new).and_return(@whm) # make the new method to return a mock object @whm.stub!(:loadavg).and_return(3) # 3 is the dummy loadavg, maybe you can change it in someth

[rspec-users] stories with selenium and the db

2008-03-20 Thread Ivo Dancet
Hi all Tonight I wanted to test out selenium in a story to test some ajax stuff on a page. After struggling for an hour or two with disappearing database objects I found the solution in a blog post by Kerry Buckley. with the comment included it reads: # Don't add an ActiveRecordSafetyListen

Re: [rspec-users] Stub / Mock - A little guidance?

2008-03-19 Thread Ivo Dancet
Op 19-mrt-08, om 16:33 heeft Dave het volgende geschreven: > Hi there, > > I'm still trying to wrap my head around when to use a stub and a mock. > If I understand this right, I should be using a 'mock' when imitating > an object, but not its behavior. I should be using a stub when I want > to imi

Re: [rspec-users] [Stories] Login and subdomain

2008-03-06 Thread Ivo Dancet
step you set your host, user name and password and you create that user. In the when steps you make the login request and then you can start doing the stuff you really want to test here as you'll have the session you want at that moment. Regards Ivo Dancet Op 6-mrt-08, om 16:12

Re: [rspec-users] [Stories] Login and subdomain

2008-03-06 Thread Ivo Dancet
I think you can also use: post "/authentication/login", { :login => user_email, :password => password }, :host => "company.example.com" Op 5-mrt-08, om 23:30 heeft Bastien het volgende geschreven: > I've just begin using rspec stories, and i m encountering some > problems. In my applica

Re: [rspec-users] can't get (r)spec to work in non-rails project

2008-02-16 Thread Ivo Dancet
Op 16-feb-08, om 19:26 heeft Steve het volgende geschreven: > On Sat, 16 Feb 2008 13:06:00 -0500, David Chelimsky wrote: >> >> The rspec/rails plugin works because there are generators which >> create >> the files for you, not because of any auto-loading facility. The >> generated files have re

Re: [rspec-users] can't get (r)spec to work in non-rails project

2008-02-16 Thread Ivo Dancet
Op 16-feb-08, om 15:13 heeft David Chelimsky het volgende geschreven: > On Feb 16, 2008 9:10 AM, Ivo Dancet <[EMAIL PROTECTED]> wrote: >> That was very quick, thanks! >> >> No, I was not (and it works when I require the file), I thought rspec >> would have some

Re: [rspec-users] can't get (r)spec to work in non-rails project

2008-02-16 Thread Ivo Dancet
On Feb 16, 2008 8:51 AM, Ivo Dancet <[EMAIL PROTECTED]> wrote: >> Hi >> >> I can't seem to get rspec and autotest to work in a small test >> project. The spec command doesn't load the implementation file. I >> found some info about non-rails projec

[rspec-users] can't get (r)spec to work in non-rails project

2008-02-16 Thread Ivo Dancet
Hi I can't seem to get rspec and autotest to work in a small test project. The spec command doesn't load the implementation file. I found some info about non-rails projects with rspec, but these did not solve my problem. I have the following files: project_map/ lib/todoist.rb

Re: [rspec-users] should_receive twice and arguments

2008-01-13 Thread Ivo Dancet
o2"}) And it did get it with ({:name => "foo"}), but only the first time... Thanks! Ivo Op 13-jan-08, om 14:00 heeft David Chelimsky het volgende geschreven: > On Jan 13, 2008 6:56 AM, Ivo Dancet <[EMAIL PROTECTED]> wrote: >> Hi all, I have a method calling Klass.

[rspec-users] should_receive twice and arguments

2008-01-13 Thread Ivo Dancet
Hi all, I have a method calling Klass.create! two times with different arguments (this happens in a class reponsable for reading in a csv file) I want to test those like this: in one test: Klass.should_receive(:create!).with(:name => "foo").once in another: Klass.should_receive(:create!).with(:

[rspec-users] multiple scenarios problem

2007-12-23 Thread Ivo Dancet
ot;, "pass") end Then "I'm logged in" do response.should be_success end end What happens is that the second scenario's response is also returning 401 and if I switch the order of the two scenar

[rspec-users] basic authentication

2007-12-23 Thread Ivo Dancet
Any recommendations on this? Regards Ivo Dancet ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users