Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Add support for validation contexts #246
commented on an outdated diff
Mar 25, 2013
|@@ -25,6 +25,30 @@|
|+ context "an attribute with a context-dependent validation" do|
|+ let(:model) do|
|+ define_model :example, :attr => :string do|
|+ validates_format_of :attr, :with => /abc/, :on => :customisable|
|+ context "without the validation context" do|
|+ it "allows a bad value" do|
|+ model.should allow_value("xyz").for(:attr)|