[rspec-users] Does RSpec work nicely with UUID primary keys?
jarkko at jlaine.net
Sat Jul 5 16:11:29 EDT 2008
On 5.7.2008, at 18.37, John Knox wrote:
> David Chelimsky wrote:
>> What happens when you run the generated examples?
> My code uses single table inheritance (STI) and a MySQL database, so I
> thought it best to create some new simple projects with a single
> (1) I created a new project using SQLite with a single model. All 58
> auto-generated specifications ran successfully.
> (2) I created a new single-model project using SQLite but added a UUID
> primary key. All 58 auto-generated specifications ran successfully.
> (3) I created a new project using MySQL with a single model. Again,
> 58 auto-generated specifications ran successfully.
> (4) (2) I created a new single-model project using MySQL but added a
> UUID primary key. All 58 auto-generated specifications ran
> Hmm. So, it's not the UUIDs that are causing problems with my
> application... but perhaps single table inheritance. Will do more
> and post again when I've better defined the problem.
The thing is, the scaffolding specs are specs for the behaviour of the
scaffolded controllers/models/views. If you want to change that
behaviour, your specs should reflect that assumption. If you add some
new code (without writing new specs for it), even in the form of using
plugins, and your existing specs still run, it doesn't mean your code
is working correctly because you didn't write specs for that part of
the functionality yet. Using UUID probably changes things so little
that (especially if/when they mock the models) it won't trip the
scaffolding specs per se.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2417 bytes
Desc: not available
More information about the rspec-users