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 controller
object, session hash, response, etc. in different
I'm studying Rspec and doing some model's tests.
I have a table with a field which must have two characters, the field
should not be empty and can not be repeated.
My doubts is with #.
describe State do
context validations do
it The abbreviation should not be empty do
What do you mean repeated? You mean you can't have an abbreviation with two of
the same letters?
Julian
On 18/04/2012, at 10:50 AM, Luciano Borges wrote:
I'm studying Rspec and doing some model's tests.
I have a table with a field which must have two characters, the field should
not be
2012/4/17 Julian Leviston jul...@leviston.net
What do you mean repeated? You mean you can't have an abbreviation with
two of the same letters?
Julian
Hi Julian,
Yes. I cat't have the same abbreviation on the table, I know that I have to
put the validation in the model, but, I'd like to
oh you mean a check for uniqueness.
Is this rails? If it is, pretty sure you can do this:
item = Item.create(:abbreviation = ab)
duplicate_item = Item.create(:abbreviation = ab)
duplicate_item.new_record?.should_be true
or
item = Item.new(:abbreviation = ab)
item.should_be valid
item.save
Sorry! My posts are very delayed.
On Apr 17, 2012, at 8:50 PM, Luciano Borges wrote:
I'm studying Rspec and doing some model's tests.
I have a table with a field which must have two characters, the field should
not be empty and can not be repeated.
My doubts is with #.
describe
On Apr 17, 2012, at 8:50 PM, Luciano Borges wrote:
I'm studying Rspec and doing some model's tests.
I have a table with a field which must have two characters, the field should
not be empty and can not be repeated.
My doubts is with #.
describe State do
context validations do
Hi,
I'm using Rails 3.1.3, rspec-rails 2.9.0, and Ruby 1.9.3p0.
I've been getting recursive errors, where one error is reported
multiple times. It's quite spectacular in a long suite, with the
errors overflowing the console buffer. I've whittled down a simple
example:
require 'spec_helper'