On Jul 23, 2012, at 10:32 AM, Ja Tse wrote:
> Hi,
>
> I have a cucumber problem that is preventing me from running all my
> feature files, anyone has come across to this problem ?
>
> On Windows with.
>
> cucumber (1.2.1, 0.9.4)
>
> Command: bundle exec cucumber
>
> C:/Ruby187/lib/ruby/gems
On Jul 22, 2012, at 3:08 PM, Salvatore Pelligra wrote:
> I'm new with Capybara and after a good amount of google, I still can't
> figure out how the #within methods works!
> I can use it only if I call visit before? There's no way to use it on a
> string, like the `page = Capybara.string(html_str
On Jul 18, 2012, at 9:30 AM, femto Zheng wrote:
> yes, using devise.
>
> On Wed, Jul 18, 2012 at 11:21 PM, Justin Ko wrote:
>
> On Jul 18, 2012, at 4:42 AM, femto Zheng wrote:
>
>> Hello all, I'm new to rspec-rails,
>> looking at rspec-rails's docume
On Jul 18, 2012, at 4:42 AM, femto Zheng wrote:
> Hello all, I'm new to rspec-rails,
> looking at rspec-rails's documentation is a bit confusing,
> I have an application,
> where users needs to login to use,
> so how do I specify login with controller spec with rspec-rails?
>
> like a config.(:b
On Jul 15, 2012, at 7:28 PM, Mike Glaz wrote:
> Describe, context, feature, scenario: what is the difference between the
> four and when do I use each one?
>
> thanks,
> mike
>
> --
> Posted via http://www.ruby-forum.com/.
> ___
> rspec-users mailing
On Jun 21, 2012, at 11:12 AM, n/a n/a wrote:
> I've been trying to learn RSpec using the book The RSpec Book by David
> Chelimsky but I've been having a problem in Chapter 5 around page 50. I
> tried running "rspec spec/codebreaker/game_spec.rb --format doc" but it
> said that codebreaker could n
On Jun 20, 2012, at 4:18 AM, David Piegza wrote:
> Hi,
>
> I'm trying to mock an UploadedFile object and pass it to a controller action.
> Unfortunately, the mocked object gets stringified in the params hash, so I'm
> not able to use the mock object in a test.
>
> Is there any way to avoid th
On Jun 14, 2012, at 12:11 PM, Joshua Muheim wrote:
> Hey guys
>
> After hours of hard work I finally managed to set up my development
> environment to run cucumber scenarios using autotest and selenium.
>
> What's a bit bugging is the fact that Firefox always jumps to the
> foreground when Auto
On Jun 16, 2012, at 3:38 PM, Tyrel R. wrote:
> Hey everyone, I am learning bdd and do deffently like it on the whole. I
> ran into a strange situation I got around it but it left a question in
> my mind and I would appreciate help in removing it ;)
>
> So hear is what happened
>
> test for one
On Jun 14, 2012, at 1:40 AM, Joshua Muheim wrote:
> Hey everybody
>
> I have worked quite to near the end of The RSpec Book, but now I'm
> having some troubles.
>
> I'm trying to get the last few Cucumber steps to work, which are:
>
> Then /^Caddyshack should be in the Comedy genre$/ do
> vis
On May 30, 2012, at 3:18 AM, zombiebit wrote:
> Hey,
> I want to test my Rails app. When you click the image ajax sends to data to
> DB and the data is updated in there. When I try to test, I faced with this
> problem,
>
>
> 1) RwsController Update widget score takes widget rate information
>
On May 23, 2012, at 6:12 PM, Patrick J. Collins wrote:
> Hi,
>
> Basically I want to do something like this:
>
> describe FancyThingsController do
>
> def do_new
>get :new
> end
>
> def do_create
>post :create, :fancy_thing => { :some => "params" }
> end
>
> shared_examples "an
On May 23, 2012, at 4:27 PM, Kleber Shimabuku wrote:
> Please help me to understand this error message:
>
> 1) PostsController#create when logged in should create a new post and
> redirect to a successful message page
> Failure/Error: post 'create', { post: {title: 'New post',
> Mock P
On May 19, 2012, at 11:46 AM, survivorist wrote:
> What was the specific issue with this and how did you resolve it, I'm having
> the exact same error and can't find the root of the issue? Thanks
>
> --
> View this message in context:
> http://ruby.11.n6.nabble.com/bug-rspec-rails-generator-ge
On May 15, 2012, at 12:47 AM, Patrick J. Collins wrote:
> Capybara has two methods:
>
> page.has_button?
>
> and
>
> page.has_link?
>
> ... I am wondering, how can I make a helper method that will be
> satisfied by one or the other? In other words, I want to be able to do:
>
> page.should
On Apr 17, 2012, at 1:30 PM, Nasir Jamal wrote:
>
> Hi
>
> We have just upgraded our Rails 2.3.11 app to Rails 3.0.0 and Rspec 1.3.2 to
> 2.6. We are having two problems with rspec currently and any help would be
> great.
>
> 1) We have some controller macros where we have been using the con
Sent from my iPhone
On Apr 15, 2012, at 4:04 PM, Michael Guterl wrote:
> On Fri, Apr 13, 2012 at 2:24 AM, Justin Ko wrote:
>>
>> On Apr 11, 2012, at 7:08 AM, Michael Guterl wrote:
>>
>>> I'm building a ruby wrapper for a SOAP service using savon and I&
On Apr 12, 2012, at 11:32 AM, Arnaldo Junior wrote:
> Hi, I have problems to implement the tests with RSpec with nested
> routes in views, as I implement these tests?
> Always gives error that it can not find the routes.
>
> #config/routes.rb
>
> resources :controller1 do
>resources :contro
On Apr 11, 2012, at 7:08 AM, Michael Guterl wrote:
> I'm building a ruby wrapper for a SOAP service using savon and I'm
> running into some issues with testing and I would love some feedback.
> I have added some tests with the help of VCR, but unfortunately that
> doesn't feel right given some of
On Apr 9, 2012, at 2:41 PM, Matt Hauck wrote:
> Is there a way to specify a message expectation on an object to occur
> _without_ a particular argument?
>
> There is a particular function, which in some special circumstance takes a
> unique argument, but in normal circumstances does not take t
On Apr 6, 2012, at 1:40 PM, Patrick J. Collins wrote:
>> On Apr 6, 2012, at 11:21 AM, Patrick J. Collins wrote:
>>> ... Changing the filename app/admin/users.rb to app/admin/wtfs.rb
>>>
>>> makes this error go away... so--- wtfs indeed!
>
> On Fri, 6 A
On Apr 6, 2012, at 11:21 AM, Patrick J. Collins wrote:
> I am working on a project that uses active_admin, and I found once
> building out all of the admin resource files, running rspec causes the
> following error:
>
> /Users/patrick/.rvm/gems/ruby-1.9.3-p125@foobar/gems/activesupport-3.2.2/lib
On Apr 5, 2012, at 6:03 PM, James wrote:
> Hi,
> I have two stubs in two different specs (one model, one controller).
> For some reason they are causing some strange conflict with one
> another.
> If I comment out the controller stub, the model spec passes.
>
> Controller Spec
>
On Apr 5, 2012, at 6:03 PM, James wrote:
> Hi,
> I have two stubs in two different specs (one model, one controller).
> For some reason they are causing some strange conflict with one
> another.
It's not strange at all. Your child classes will inherit the stubs of the
parent class.
> If I comm
Sent from my iPhone
On Mar 31, 2012, at 5:50 AM, David Chelimsky wrote:
> On Sat, Mar 31, 2012 at 2:49 AM, Justin Ko wrote:
>>
>> On Mar 30, 2012, at 11:11 PM, Fearless Fool wrote:
>>
>>> This is a rehash of a question I posed at:
>>> http://stacko
On Mar 30, 2012, at 11:11 PM, Fearless Fool wrote:
> This is a rehash of a question I posed at:
> http://stackoverflow.com/questions/9952317/isolating-controller-tests-from-models
> The basic question: If I have a FoosController and a Foo model, can I
> run FoosController rspec tests without crea
On Mar 30, 2012, at 10:52 AM, Hillary Hueter wrote:
>
> The example as it exists today:
>it "should show all applications" do
> I.new do |c|
> c.login_flow(:userid => $support, :password => $password) ## Logs in
> c.manage_application_page.filter.when_present.flash
>
On Mar 17, 2012, at 3:51 PM, Myron Marston wrote:
> I've been thinking about this a bit ever since Zach Dennis brought up
> the issue on another rspec-expectations ticket [1]. I've come up with
> a proof-of-concept matcher that works pretty well, I think [2].
> Here's how you use it:
>
> expect
On Mar 14, 2012, at 1:15 AM, Srushti Ambekallu wrote:
> We're working on a project with a bunch of padrino services running on JRuby
> 1.6.5. Currently, the tests are written Test::Unit, but we want to move to
> writing specs. We tried rspec but that seemed to fail, until we looked closer
> an
On Feb 27, 2012, at 10:58 AM, jed schneider wrote:
> we are on rspec 2.6.4 and for awhile my color flag seems to be ignored when
> running specs in my .rspec file but my formatting option is picking up. Did
> the --color flag get changed?
>
> my .rspec file
> --color
> -f d
>
> thanks!
>
>
On Mar 5, 2012, at 1:18 AM, ruud144 wrote:
> hi group,
>
> I read that expectations can print a custom message on failure using a
> syntax like
>
> cars.should be_empty, "Cars left"
This is because RSpec predicate matchers can accept a block:
https://github.com/rspec/rspec-expectations/blob/ma
On Mar 5, 2012, at 5:05 AM, Andrew Premdas wrote:
>
> On 3 March 2012 21:55, Greg C. wrote:
> Background: So I have roughly:
>
> class A
> def calculate_input_datetimes
> # do stuff to calculate datetimes - then for each one identified
> process_datetimes(my_datetime_start, my_dat
On Mar 3, 2012, at 12:35 PM, S Ahmed wrote:
> I'm testing my controller, and confirming that a logged-in user can view the
> page.
>
> I have a session_helper that does this:
>
> def signed_in?
> !current_user.nil?
> end
>
> And the current_user is set with:
>
> def user_from_remember_to
On Mar 3, 2012, at 2:55 PM, Greg C. wrote:
> Background: So I have roughly:
>
> class A
> def calculate_input_datetimes
> # do stuff to calculate datetimes - then for each one identified
> process_datetimes(my_datetime_start, my_datetime_end)
> end
>
> def process_datetimes(inp
estart my
> terminal more often!
>
> On Wednesday, February 29, 2012 6:18:10 AM UTC-3, Justin Ko wrote:
>
> On Feb 28, 2012, at 9:43 PM, Mohamad El-Husseini wrote:
> > I ran this scenario in the console and it works as expected. But RSpec
> > keeps failing the test and I can
On Feb 28, 2012, at 9:43 PM, Mohamad El-Husseini wrote:
> I ran this scenario in the console and it works as expected. But RSpec keeps
> failing the test and I can't understand why.
>
> describe User do
>
> before do
> @user = User.new(name: "Mickey Mouse", email: "mic...@disney.com",
>
On Feb 23, 2012, at 4:38 PM, Mohamad El-Husseini wrote:
> I'm new to RSpec, Rails, and Ruby. I'm following the Rails Tutorial. I was
> going over some RSpec code and go wanted some clarification:
>
> describe "User pages" do
> subject { page }
>
> describe "sign up" do
> describe "
On Feb 23, 2012, at 9:32 AM, Tom Tom wrote:
> I am following railstutorial 2nd edition and in it we have a Signin test
> in our integration tests as follows:
>
> require 'spec_helper'
>
> describe "Authentication" do
>
>subject { page }
>
> describe "signin" do
> before { visi
On Feb 22, 2012, at 9:00 AM, Matt Wynne wrote:
>
> On 22 Feb 2012, at 15:41, David Chelimsky wrote:
>
>> On Tue, Feb 21, 2012 at 2:48 PM, Mike Pack wrote:
>>> Yup, I find myself doing this all the time. I think it should be considered
>>> that too deep of a stub chain could be a sign of poor
>
Do you often find yourself doing this:
active = double('active')
active.should_receive(:first)
users = double('users', active: active)
account.should_receive(:users).and_return(users)
for this:
account.users.active.first
?
Of course, we could use stub_chain, but that doesn't let us know
*where
On Feb 15, 2012, at 9:57 AM, Serguei Cambour wrote:
> I just tried to integrate a simple test to check some options passed as
> argument to a class to be executed:
> [code]
> require 'spec_helper'
>
> module PropertyInjector
> describe Options do
>describe "#source folder option" do
>
On Feb 14, 2012, at 9:23 AM, David Chelimsky wrote:
> On Tue, Feb 14, 2012 at 9:28 AM, Justin Ko wrote:
>>
>> On Feb 13, 2012, at 10:35 PM, David Chelimsky wrote:
>>
>>> On Mon, Feb 13, 2012 at 9:04 PM, Justin Ko wrote:
>>>>
>>>>
On Feb 14, 2012, at 9:57 AM, John Chow wrote:
> Hey Everyone,
>
> Quick question: is there a way to format the example text such that it's in
> nested format (much like the option rspec -cfn)? It's visually easier for me
> to read and comprehend the failures and pending examples.
I think "rsp
On Feb 13, 2012, at 10:35 PM, David Chelimsky wrote:
> On Mon, Feb 13, 2012 at 9:04 PM, Justin Ko wrote:
>>
>> On Feb 13, 2012, at 1:16 PM, Patrick J. Collins wrote:
>>
>>> Hi,
>>>
>>> I was writing an integration test for my user signup form
On Feb 13, 2012, at 3:46 PM, Cathal Curtis wrote:
> Hi All,
>
> I'd like to get some other's opinions on testing controllers.
>
> Say I have a model and I want to prevent deletion of instances of it.
> The controllers's destroy action simply redirects to an error page -
> nothing else.
> Lets a
On Feb 13, 2012, at 1:16 PM, Patrick J. Collins wrote:
> Hi,
>
> I was writing an integration test for my user signup form (with
> capybara), and found that my test was failing due to a validation error:
> "email is already taken". I'm a bit confused because I thought when I
> run "rspec spec/s
On Feb 9, 2012, at 1:42 PM, Bryan Baugher wrote:
> Hi,
>
> I was trying to use the autorun feature of rspec but noticed that when I run
> the command to kick off the ruby scripts it picks up the options that I give
> to the command.
>
> 'myRubyBin -j optionValue'
>
> This then fails with thi
On Feb 6, 2012, at 6:45 PM, Patrick J. Collins wrote:
> I've got a share method in my controller, and I have the following spec:
>
> describe PostsController do
>
>describe "#share" do
>
> it "doesn't blow up" do
>post :share, :id => @post.id
Does @post actually have an id?
On Feb 3, 2012, at 3:29 PM, apneadiving wrote:
> Hi,
>
> That's a bit off topic but since I use Spork + Rspec...
>
> Well, my classes are reloaded between each test wave so Rails'
> "memoize" method raises an error (which is expected, see code:
> http://rubydoc.info/docs/rails/3.0.0/ActiveSuppo
On Feb 2, 2012, at 2:20 AM, Romain Tribes wrote:
> Hello,
>
> I'm writing webgames with Rails and I want to test my code (and even TDD) but
> I'm really stuck figuring what to test.
> I read a lot of articles on the subject but I still don't know what to do in
> my case: how to start?
>
> For
On Feb 1, 2012, at 6:26 PM, Lille wrote:
> Hey folks,
>
> Using 2.6, I have functional tests arranged in my spec/controllers
> directory according to their namespace in my Rails 3 app/controllers
> directory, e.g.,
>
> api/some_controller_spec.rb
>
> describe Api::SomeController, ...
>
> We
On Jan 26, 2012, at 8:44 AM, Yi Wen wrote:
> Say I do:
>
> ```ruby
> object.method 5.days.ago
> ```
>
> In the test I want to test using should_receive like:
>
> ```ruby
> object.should_receive(:method).with(5.days.ago)
> ```
>
> This will fail since two time objects aren't exact the same.
>
On Jan 25, 2012, at 6:20 PM, Guyren Howe wrote:
> On Jan 25, 2012, at 4:50 PM, Guyren G Howe wrote:
>
>> On Jan 25, 2012, at 1:56 PM, David Chelimsky wrote:
>>
>>> I'd start by debugging to see where the wheels fall off. Are you
>>> familiar/comfortable with Ruby's debugger?
>>
>> Sure.
>>
>>
On Jan 25, 2012, at 1:42 AM, Patrick J. Collins wrote:
> On Wed, 25 Jan 2012, Justin Ko wrote:
>
>>
>> http://ariejan.net/2008/08/12/ruby-on-rails-uuid-as-your-activerecord-primary-key
>>
>> Make sure the column is 16-byte binary
>>
>
> And be sur
On Jan 25, 2012, at 12:43 AM, Guyren G Howe wrote:
>
> On Jan 24, 2012, at 11:27 PM, Julian Leviston wrote:
>
>> On 25/01/2012, at 5:24 PM, Guyren G Howe wrote:
>>
>>> My code that saves a record works fine in development or production, or
>>> from the console. I can take the code in my test
On Jan 16, 2012, at 7:35 PM, S Ahmed wrote:
> With jruby and rspec requests, do you have to use selenium webdriver?
>
> I'm confused, with ruby and rubyonrails using cucumber with capybara, I
> didn't have to set the default driver, what was it using and can i use that
> with jruby? Things ju
On Jan 12, 2012, at 5:32 PM, Fearless Fool wrote:
> I have two blocks of tests: one for testing positive outcomes and one
> for testing negative. After poking around, I've concluded that the
> underlying :verify_credentials method is getting called, despite the
> stub:
>
> describe 'electricit
On Jan 6, 2012, at 3:49 PM, Gayle C. wrote:
> David Chelimsky wrote in post #790531:
>>> http://wiki.github.com/aslakhellesoy/cucumber/running-features
>>
>> Since ppl are having a hard time finding this, I added
>> http://wiki.github.com/aslakhellesoy/cucumber/cucumberyml, which
>> references
>
On Dec 22, 2011, at 11:33 AM, LeeQ wrote:
> Ah, I see what you are saying. But no, I still want the exception to act
> like an exception. My problem is that I'll have a test fail for reasons
> unknown, and I then I need to open the test logs to find the exception. I'd
> like those exception
On Dec 22, 2011, at 8:25 AM, LeeQ wrote:
> Puts does work. That's not what I'm looking for.
>
> I want all error messages (like `undefined local variable or method `junk'
> for...` ) to show up in my rspec out put in the same way as `puts`.
> ___
> r
On Dec 12, 2011, at 10:16 AM, astjohn wrote:
> All,
>
> I've been having issues with my namespaced controllers and specs. I
> receive the following errors only on my create and update actions
> (with invalid parameters) and only on my namespaced controllers. My
> non-namespaced controllers hav
On Dec 16, 2011, at 8:46 AM, LeeQ wrote:
> I am using Capybara in combination with rspec for integration testing
> of rails apps.
Even though you are using Capybara, they are still just specs. No reason why
"puts" won't work.
>
> I would like any errors (routing errors, errors in a controller
On Dec 5, 2011, at 3:53 PM, Gordon wrote:
> Hi, there,
>
> I have some methods which I have written as helpers.
> They are in spec/support/controller_macros.rb (yes, I will change the
> name soon).
>
> The 2 methods, login_user and login_admin_user works in the
> controller specs BUT fail to wo
On Nov 26, 2011, at 8:03 PM, Cynthia Kiser wrote:
> Quoting Patrick J. Collins :
>>> I can work around it by constructing the url myself with
>>> "/messages/#{message.id}" but I am curious where the period is coming
>>> from in the constructed url.
>>
>> It's because you should be using a singu
On Nov 22, 2011, at 4:52 PM, Andrew Premdas wrote:
> On 22 November 2011 20:31, Ash Moran wrote:
>> Hi
>>
>> I've worked on a couple of Rails 3 apps recently and the test feedback loop
>> is killing me. With no modifications, it takes 15-25 seconds to run a single
>> example. I've avoided Spo
On Nov 19, 2011, at 11:14 PM, Patrick J. Collins wrote:
>> Please post the backtrace.
>
> Failures:
>
> 1) PostsController#store_post_params stores the last post params in the
> session
> Failure/Error: post :create, { :submit_action => submit_type.to_s, :post
> => { :foo => "bar" } }
>
On Nov 19, 2011, at 4:03 PM, Patrick J. Collins wrote:
>> #store_params is not an "action", therefore I would make it private.
>
> I agree completely, and probably should have specified that in my sample code
> (it certainly is private in my real non-hypothetical implementation).
>
>> Since it
On Nov 19, 2011, at 9:57 AM, Patrick J. Collins wrote:
>>> I never see the debugger prompt.. Can anyone PLEASE tell me why this is not
>>> working? In any other test, binding.pry or debugger interrupts the test
>>> flow
>>> and gives me access to the current scope of the debugger call.
>>
>>
Tony, this text right here is considered "top posting" because it is *above*
the previous posts. Now, scroll down and you'll see my "bottom post".
On Nov 13, 2011, at 11:03 PM, Tony Spore wrote:
> Thanks David.
> I am getting a long way now.
> -Thanks,
> Tony Spore
> CEO
> SaasSoft LLC
> (805)
On Nov 8, 2011, at 3:29 AM, Rob Aldred wrote:
> On Tue, Nov 08, 2011 at 12:36:22AM +0000, Justin Ko wrote:
>>
>> On Nov 7, 2011, at 4:13 PM, Matt Wynne wrote:
>>
>>>
>>> On 7 Nov 2011, at 18:37, Justin Ko wrote:
>>>
>>>> On Nov 2,
On Nov 7, 2011, at 4:13 PM, Matt Wynne wrote:
>
> On 7 Nov 2011, at 18:37, Justin Ko wrote:
>
>> On Nov 2, 2011, at 12:01 PM, Rob Aldred wrote:
>>
>>>
>>> I'm pretty sure this has probably been discussed before.
>>> I'm using couchd
On Nov 2, 2011, at 12:01 PM, Rob Aldred wrote:
>
> I'm pretty sure this has probably been discussed before.
> I'm using couchdb (couchrest_model)
>
> When speccing my controller i want to set expectations that im calling my
> couch views correctly.
> The query interface has recently been update
On Oct 28, 2011, at 10:16 AM, internetchris wrote:
> Hi Group
>
> I'm still waiting for the light to come on with stubbing/mocking and
> the syntax for each. I have simple method in my Order class like
> so
>
> def credit_card
>ActiveMerchant::Billing::CreditCard.new(
> :type
On Oct 18, 2011, at 9:03 AM, Bill Christian wrote:
> I am trying to write a custom formatter to update a database record based on
> example results. Having a lot of trouble, so I thought to ask if anyone has a
> custom formatter that writes results to a database or outputs results in JSON
> or
On Oct 16, 2011, at 3:47 AM, Marten Veldthuis wrote:
> Hey guys,
>
> Is there any way I can get rspec to ignore all files in spec/fixtures when it
> does a recursive search for all spec/**/*_spec.rb files?
>
> The problem I'm facing is that the fixtures for my code are project
> structures on
On Oct 13, 2011, at 10:40 PM, Gordon wrote:
> Hi, all :)
>
> I have some working support helpers defined in spec/support/
> controller_macros.rb.
>
> I'm running "rake spec" before a 'git commit' and observed that the
> spec request for my 'brands' controller,
> spec/requests/brands_spec.rb fai
On Oct 13, 2011, at 9:43 PM, slavix wrote:
> strange install related problems in my rails 3.1 app
> gemfile
> group :test, :development do
> ..
> gem "rspec"
> gem "rspec-rails"
> gem 'rspec-rails-ext'
> gem 'rspec-rails-matchers'
> ..
> end
>
>>> bundle show rspec-rails
> /home/slava/.rvm/
On Oct 13, 2011, at 8:59 PM, Gordon wrote:
>
>
> Hi, there,
>
>
> I believe I have some problem with scoping.
>
> I have a controller spec file which tests a brands resource.
> At the start of the file, I test the resource's access for different
> users in a context block
> a) not signed in
On Oct 13, 2011, at 7:35 PM, Gordon wrote:
>
>
> Hi, there,
>
>
> I believe I have some problem with scoping.
>
> I have a controller spec file which tests a brands resource.
> At the start of the file, I test the resource's access for different
> users in a context block
> a) not signed in
On Oct 1, 2011, at 7:03 AM, Felix Schäfer wrote:
> Hello,
>
> Is there some way to override a spec and more specifically parts of spec,
> ideally down to a specific example? I've been looking and googling for
> something like this, but I haven't found a good strategy for it.
>
> The use-case
On Sep 15, 2011, at 3:08 AM, Silumesii Maboshe wrote:
> Hello!
>
> I am learning to use RSpec for testing Rails 3.1 applications - really
> enjoying using it so far.
> In testing for the presence of assets (e.g rails.png), I've been using:
>
> get "/assets/rails.png"
> response.status.shou
On Sep 16, 2011, at 4:40 AM, Joaquin Rivera Padron wrote:
> hi,
> at work we use TestUnit, and I miss there a lot the shared_examples from
> RSpec, do you know if is there something alike for TestUnit?
>
> I know this might be a bit OT but I thought you probably might know :-)
>
> tia,
> joaqui
On Sep 16, 2011, at 12:33 PM, mattf wrote:
> Hey there,
>
> I am needing to stub a 'current_user' method in an Rspec/capybara
> request spec. The method is defined in ApplicationController and is
> using helper_method. The method should simply return a user id.
>
> Alternatively, I could fix my
"have_[xpath]" is a custom matcher in Capybara. So, the answer would be no.
https://github.com/jnicklas/capybara/blob/master/lib/capybara/rspec/matchers.rb
On Sep 20, 2011, at 3:45 PM, Patrick J. Collins wrote:
> I am doing:
>
> page.should have_xpath("//img[contains(@class, 'foobar')]",
nfidence and are intended solely for the use of the individual or
> entity to whom they are addressed. If you have received this email
> in error please notify the system manager at i...@stardotstar.com
>
> On Thursday, 15 September 2011 at 01:52, Justin Ko wrote:
>
> >
On Wed, Sep 14, 2011 at 6:51 AM, Rob Aldred wrote:
> I'm speccing a small lib which manipulates image files using mini_magick.
> The lib creates various temporary files during the process, the lib then
> cleans up the temporary files at the end.
>
> I'm trying to mock expectations that the calls
On Tue, Sep 13, 2011 at 8:53 PM, slavix wrote:
> Hi,
> Anyone can help me with rspec shoulda validations please.
> I can't get the syntax right for these validations. Please correct me
>
>it { should have_one :tradable, :through => :trade_order}
>it { should belong_to :source, :polymor
On Tue, Sep 13, 2011 at 6:56 AM, Matt Wynne wrote:
> Hi all,
>
> In GOOS[1] they use an assertion called assertEventually which samples the
> system for a success state until a certain timeout has elapsed. This allows
> you to synchronise the tests with asynchronous code.
>
> Do we have an equiva
On Thu, Sep 8, 2011 at 3:03 PM, Justin Beck wrote:
> I have a class that expects some input via 'gets'. I found that, when
> testing, I can do something as simple as this:
>
> @foo.stub!(:gets) { "stuff\n" }
>
> However that only works in the most simple case. In my case the class asks
> a seri
On Wed, Sep 7, 2011 at 5:50 AM, John Feminella wrote:
> Is there a way to run an `around` block once for every spec *file*
> (not spec)? (I want to measure which files take the longest amount of
> time, count the number of specs in each file, and then report the
> average spec running time for tha
On Wed, Sep 7, 2011 at 6:08 AM, John Feminella wrote:
> Is there a way to warn but not fail if a particular method wasn't
> called? That is, I'm looking for something that's halfway between
> obj.stub(...) and obj.should_receive(...). I'm trying to do something
> like this:
>
> shared_context "wit
On Tue, Sep 6, 2011 at 9:40 PM, slavix wrote:
> Hello,
> Is there any way to test model inheritance in spec?
>
> something like..
> it { ChildModel.should < ParentModel }
>
> thanks.
> ___
> rspec-users mailing list
> rspec-users@rubyforge.org
> http:/
On Fri, Aug 26, 2011 at 12:12 AM, Matthias Siegel
wrote:
>
> On 25/08/2011, at 11:45 PM, Justin Ko wrote:
>
>
>
> On Thu, Aug 25, 2011 at 7:38 AM, Matthias Siegel > wrote:
>
>>
>> On 25/08/2011, at 11:10 AM, Justin Ko wrote:
>>
>>
>&g
On Thu, Aug 25, 2011 at 7:38 AM, Matthias Siegel
wrote:
>
> On 25/08/2011, at 11:10 AM, Justin Ko wrote:
>
>
>
> On Wed, Aug 24, 2011 at 6:40 PM, Matthias Siegel > wrote:
>
>> Hi,
>>
>> I'm fairly new to RSpec with Rails and I'm trying to wor
On Wed, Aug 24, 2011 at 6:40 PM, Matthias Siegel
wrote:
> Hi,
>
> I'm fairly new to RSpec with Rails and I'm trying to work out how I can
> write request specs for resources that require a logged in user.
>
> I can't get this one to pass:
>
>
> describe "GET /admin/account" do
>
> it "should have
On Tue, Aug 23, 2011 at 6:22 AM, Gordon Yeong wrote:
> I found out why it was not working.
>
> The line, 'Part.should_receive(:update_attributes).with('title' => 'Brake
> pads').and_return(part)' should not be there because the controller specs
> should not care about implementation (ie. how thin
On Tue, Aug 23, 2011 at 6:11 AM, Gordon Yeong wrote:
>
>> Do you have a before filter somewhere that is preventing the
>> :update_attributes message from being received?
>>
>> I have checked my application's controllers
> (app/controllers/application_controller.rb and
> app/controllers/parts_co
Sent from my iPhone
On Aug 22, 2011, at 11:25 PM, "Nishith R." wrote:
> For sake of completeness, if you are using bundle in rails3, and don't
> want to invoke rake [to save init time], you can also execute it the
> following way:
>
> bundle exec cucumber --guess --profile default
> path/f
Sent from my iPhone
On Aug 22, 2011, at 10:14 PM, ct9a wrote:
>
>
> On Aug 23, 1:55 pm, Justin Ko wrote:
>> On Mon, Aug 22, 2011 at 9:09 PM, ct9a wrote:
>>
>>> Thanks, Justin.
>>
>>> I have the part object mocked up before e
On Mon, Aug 22, 2011 at 9:09 PM, ct9a wrote:
>
>
> Thanks, Justin.
>
> I have the part object mocked up before each spec runs.
>
> --- Extract begins -
>
>let(:part){
>mock_model('Part').as_null_object
>}
>
>before do
>Part.stub(:new).and_return(par
1 - 100 of 195 matches
Mail list logo