Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added simple spec to make sure fields exists.
- Loading branch information
Doug Youch
committed
Nov 30, 2010
1 parent
83a2dae
commit e42497b
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require File.dirname(__FILE__) + "/../spec_helper" | ||
|
||
describe EndUserTokenSegmentField do | ||
it "should only have valid EndUserToken fields" do | ||
obj = EndUserTokenSegmentField.user_segment_fields_handler_info[:domain_model_class].new | ||
EndUserTokenSegmentField.user_segment_fields.each do |key, value| | ||
if value[:field].is_a?(Array) | ||
value[:field].each { |fld| obj.has_attribute?(fld).should be_true } | ||
else | ||
obj.has_attribute?(value[:field]).should be_true | ||
end | ||
obj.respond_to?(value[:display_field]).should be_true | ||
end | ||
end | ||
end |