Created
April 3, 2009 18:12
-
-
Save maiha/89871 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe ConstraintSchema do | |
table_fixture :constraint_schemas, <<-EOF, :name=>"name" | |
select * from constraint_schemas; | |
id | type | name | js | position | multiple | escape | enabled | version | |
----+-----------+------------+----------------------+----------+----------+--------+---------+--------- | |
16 | Selection | 性別 | user_gender() == | 1 | f | t | t | | |
17 | Selection | 興味 | user_interests() in | 2 | t | t | t | | |
18 | Field | 回数制約 | user_freq() < | 3 | f | f | t | | |
19 | Checkbox | 新規ユーザ | user_newbie() | 4 | f | f | t | | |
20 | Custom | カスタム | | 5 | f | f | t | | |
22 | Custom | プレミアム | is_premium_user() | 6 | f | f | t | | |
EOF | |
describe "ItemHistory レベルで強制的につけられた制約" do | |
it "Customが正しく動作すること" do | |
premium = constraint_schemas("プレミアム") | |
premium.js.should == "is_premium_user()" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment