29 May '12, 4am

shouldaにはallow_mass_assignment_of matcherがあるのか。 / #!/bin/blog - Testing mass assignment with RSpec-Shoulda

If you're new to Rails, or if you've been using Rails 2 for a long time, you might not be aware that Shoulda offers an allow_mass_assignment_of matcher that works just like it sounds. Here's the example from the source code : it { should_not allow_mass_assignment_of(:password) } it { should allow_mass_assignment_of(:first_name) } Having explicit tests for whether fields should be mass-assignable is probably safer than letting developers arbitrarily add or remove fields from the attr_accessible declarations -- at least when they break a test they'll have to think twice about it.

Full article: http://pivotallabs.com/users/mrushakoff/blog/articles/213...

Tweets

Green Blog: Expert Links Dolphin Deaths to Sona...

green.blogs.nytimes.com 28 May '12, 7pm

Agence France-Presse — Getty Images Experts measured a dead dolphin that washed ashore near Chiclayo in northwestern Peru....

Expert Links Dolphin Deaths to Sonar Testing

green.blogs.nytimes.com 28 May '12, 7pm

Agence France-Presse — Getty Images Experts measured a dead dolphin that washed ashore near Chiclayo in northwestern Peru....

Expert Links Dolphin Deaths to Sonar Testing

green.blogs.nytimes.com 28 May '12, 7pm

Agence France-Presse — Getty Images Experts measured a dead dolphin that washed ashore near Chiclayo in northwestern Peru....

Green Blog: Expert Links Dolphin Deaths to Sona...

green.blogs.nytimes.com 28 May '12, 7pm

Agence France-Presse — Getty Images Experts measured a dead dolphin that washed ashore near Chiclayo in northwestern Peru....

RSpec:

rspec.info 03 Jun '12, 9pm

The RSpec Book will introduce you to RSpec, Cucumber, and a number of other tools that make up the Ruby BDD family. Replet...

Sports fitness testing using the YSI 2300: Tees...

laboratorytalk.com 28 May '12, 3pm

Teesside University carries out fitness testing for all levels of ability, seven days a week. The service has three exerci...