features/sets_validations.feature in valle-0.0.3 vs features/sets_validations.feature in valle-0.1.0
- old
+ new
@@ -13,15 +13,18 @@
When I write to "test/unit/user_test.rb" with:
"""
require 'test_helper'
class UserTest < ActiveSupport::TestCase
+ setup do
+ @user = FactoryGirl.create(:user)
+ end
+
test "should not save user when name is too long" do
- user = FactoryGirl.create(:user)
- user.name = 'a' * 256
+ @user.name = 'a' * 256
- assert !user.save
- assert_equal 1, user.errors.count
+ assert !@user.save
+ assert_equal 1, @user.errors.count
end
end
"""
When I successfully run `bundle exec rake test --trace`
Then the output should contain "1 tests, 2 assertions, 0 failures, 0 errors"