#product.yml
one:
title: MyString
description: MyText
image_url: MyString
price: 99.99
two:
title: MyString
description: MyText
image_url: MyString
price: 99.99
ruby:
title: Programming Ruby 1.9
description: MyText
image_url: MyString.png
price: www
require 'test_helper'
class StoreControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
assert_select '#columns #side a', minimum: 4
assert_select '#main .entry', 3
assert_select 'h3', 'Programming Ruby 1.9'
assert_select '.price', /[\d]+\.\d\d/
end
end
Сдесь с выхлопом все норм:
Run options: --seed 45596
# Running:
............
Finished in 0.478399s, 25.0837 runs/s, 81.5220 assertions/s.
12 runs, 39 assertions, 0 failures, 0 errors, 0 skips
Но почему???
А вот как в книге
one:
title: MyString
description: MyText
image_url: MyString
price: 99.99
two:
title: MyString
description: MyText
image_url: MyString
price: 99.99
ruby:
title: Programming Ruby 1.9
description: MyText
image_url: MyString.png
price: 99.99
require 'test_helper'
class StoreControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
assert_select '#columns #side a', minimum: 4
assert_select '#main .entry', 3
assert_select 'h3', 'Programming Ruby 1.9'
assert_select '.price', /\$[,\d]+\.\d\d/
end
end
Тест не проходит:
Run options: --seed 3724
# Running:
...........F
Finished in 0.483193s, 24.8348 runs/s, 80.7131 assertions/s.
1) Failure:
StoreControllerTest#test_should_get_index [/home/beerdy/Dev/depot/test/controllers/store_controller_test.rb:10]:
<(?-mix:\$[,\d]+\.\d\d)> expected but was
<99.99>..
Expected 0 to be >= 1.
12 runs, 39 assertions, 1 failures, 0 errors, 0 skips
Почему так????