Displaying 2 results from an estimated 2 matches for "design_industry_user_interests".
2007 May 05
4
autogenerated it (was ''Custom Matcher and NAME NOT GENERATED annoyance'')
...7, Luis Lavena <luislavena at gmail.com> wrote:
> > describe "A User (in general)" do
> > before(:each) do
> > @user = User.new
> > end
> >
> > it { @user.should have_many(:contest_public_votes) }
> > it { @user.should have_many(:design_industry_user_interests) }
> > it { @user.should have_one(:user_extension) }
> > end
> >
When I''ve used the autogenerated names, I''ve used specify:
specify { @user.should have_many(:contest_public_votes) }
specify { @user.should have_many(:design_industry_user_interests) }
specify {...
2007 May 04
2
Custom Matcher and NAME NOT GENERATED annoyance
...l the "examples", I have created a
few matchers to fulfill associations and validations of attributes.
Example:
describe "A User (in general)" do
before(:each) do
@user = User.new
end
it { @user.should have_many(:contest_public_votes) }
it { @user.should have_many(:design_industry_user_interests) }
it { @user.should have_one(:user_extension) }
end
That creates the following descriptions:
A User (in general)
- should has_many contest_public_votes
- should has_many design_industry_user_interests
- should has_one user_extension
A new User
- should not be valid without first_name
- should...