Sha256: 6cca4f408e3a378c2128b34f9c09c5baf978194a7b8faee901bf1fdfff536713
Contents?: true
Size: 850 Bytes
Versions: 10
Compression:
Stored size: 850 Bytes
Contents
require "test/test_helper" class ValidationTest < ActiveSupport::TestCase context "A model that has and validates its role" do setup do @user = User.new() end context "that has a role_name mapping to a role" do setup do @user.role_name = "admin" end should "be valid" do assert @user.valid? end end context "that has a blank role_name" do setup do @user.role_name = "" end should "not be valid" do assert !@user.valid? end end context "that has a role_name not mapping to a role" do setup do @user.role_name = "nonexisting_role_name" end should "not be valid" do assert !@user.valid? end end end end
Version data entries
10 entries across 10 versions & 4 rubygems