Re: [rspec-users] stale records with integration testing?

2012-02-14 Thread Patrick J. Collins
> > 2.) DatabaseCleaner: > > > > RSpec.configure do |config| > >  config.before { DatabaseCleaner.start } > >  config.after { DatabaseCleaner.clean } > > end > > > > Look into what those do. Let us know if you get stuck. > > What Justin says is true if you're running in the same process. If > you'

Re: [rspec-users] stale records with integration testing?

2012-02-14 Thread David Chelimsky
On Tue, Feb 14, 2012 at 1:36 AM, Patrick J. Collins wrote: >> > 2.) DatabaseCleaner: >> > >> > RSpec.configure do |config| >> >  config.before { DatabaseCleaner.start } >> >  config.after { DatabaseCleaner.clean } >> > end >> > >> > Look into what those do. Let us know if you get stuck. >> >> What

Re: [rspec-users] requests versus cucumber

2012-02-14 Thread David Chelimsky
On Mon, Feb 13, 2012 at 8:31 PM, S Ahmed wrote: > For those of you who have used both rspec requests and cucumber, could you > summarize the main differences between the two? I realize that you're trying to solve a problem and we're here to be helpful, but the helpful people on this list voluntee

Re: [rspec-users] Should I use cucumber or Controller RSpecs or both?

2012-02-14 Thread Andrew Premdas
On 13 February 2012 22:46, 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 assum

Re: [rspec-users] stale records with integration testing?

2012-02-14 Thread Justin Ko
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 (with >>> capybara), and found that my test was fa

Re: [rspec-users] stale records with integration testing?

2012-02-14 Thread Patrick J. Collins
> This could happen for one of two reasons: > > 1. The email is already in the database before you run your specs. > > To avoid this, use DatabaseCleaner to truncate the tables once before > each run (not before each example). > > 2. Models are generated in before(:all) blocks, which are not > i

Re: [rspec-users] stale records with integration testing?

2012-02-14 Thread David Chelimsky
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 13, 2012, at 1:16 PM, Patrick J. Collins wrote: >>> Hi, I was writing an integration test for my user sig

[rspec-users] Formatting Pending/Failures Output

2012-02-14 Thread John Chow
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. Thanks, John P.S. First time posting here, so I gotta say that I l

[rspec-users] Upgrading to rails 3.2.1 from 3.2.0 now causes my some specs to fail

2012-02-14 Thread croceldon
I'm using rvm with ruby 1.9.3, and RubyGems at 1.8.16. All my specs pass with Rails 3.2, but at Rails 3.2.1, I get the following error: 1) DocumentLibrary can be shown on the company menu Failure/Error: doclib = Factory(:document_library, title: 'Test', menu: false, company: true) Argu

[rspec-users] RSpec spec works on rails 3.2.0, fails on 3.2.0

2012-02-14 Thread Jason Floyd
I have a spec that passes in rails 3.2.0, but fails in 3.2.1, and I have no idea why. Here's the spec: it "can be shown on the company menu" do doclib = Factory(:document_library, title: 'Test', menu: false, company: true) doclib.should be_valid end Here's the error message I get when runnin

Re: [rspec-users] Formatting Pending/Failures Output

2012-02-14 Thread Justin Ko
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

Re: [rspec-users] RSpec spec works on rails 3.2.0, fails on 3.2.0

2012-02-14 Thread David Chelimsky
On Tue, Feb 14, 2012 at 1:14 PM, Jason Floyd wrote: > I have a spec that passes in rails 3.2.0, but fails in 3.2.1, and I have > no idea why. > > Here's the spec: > > it "can be shown on the company menu" do >  doclib = Factory(:document_library, title: 'Test', menu: false, > company: true) >  doc

Re: [rspec-users] stale records with integration testing?

2012-02-14 Thread Justin Ko
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 13, 2012, at 1:16 PM, Patrick J. Collins wrote: >