# Agile Web Development with Rails 7: Test in Iteration C4 not work

**URL:** <https://forum.devtalk.com/t/agile-web-development-with-rails-7-test-in-iteration-c4-not-work/124627>\
**Category:** PragProg Customers\
**Tags:** book-agile-web-development-with-rails-7, question\
**Created:** [15 September 2023 16:08 UTC](https://forum.devtalk.com/t/agile-web-development-with-rails-7-test-in-iteration-c4-not-work/124627 "2023-09-15T16:08:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![itsmegrave](https://forum.devtalk.com/user_avatar/forum.devtalk.com/itsmegrave/32/5401_2.png) [@itsmegrave](https://forum.devtalk.com/u/itsmegrave)\
**Post date:** [15 September 2023 16:08 UTC](https://forum.devtalk.com/t/agile-web-development-with-rails-7-test-in-iteration-c4-not-work/124627/1 "2023-09-15T16:08:30Z")

</div>

@rubys

Hello everyone. I’m following the test on page 109, but it not works ☹  
When I ran this test, it breaks on line 10 (`assert_select 'h2', 'Programming Ruby 1.9'`

```auto
class StoreControllerTest < ActionDispatch::IntegrationTest
  test 'should get index' do
    get store_index_url
    assert_response :success
    assert_select 'nav a', minimum: 4
    assert_select 'main ul li', 3
    assert_select 'h2', 3
    assert_select 'h2', 'Programming Ruby 1.9'
    assert_select 'div', /\$[,\d]+\.\d\d/
  end
end

```

The error message:

```auto
# Running:

F

Failure:
StoreControllerTest#test_should_get_index [/home/grave/workspace/personal/learning/depot/test/controllers/store_controller_test.rb:10]:
Expected: "Programming Ruby 1.9"
  Actual: "MyString".
Expected 0 to be >= 1.

```

and my fixture:

```auto
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
  title: MyString
  description: MyText
  image_url: lorem.jpg
  price: 9.99

two:
  title: MyString
  description: MyText
  image_url: lorem.jpg
  price: 9.99

ruby:
  title: Programing Ruby 1.9
  description: Ruby if the fastest growing and most exciting dynamic
    language out there. If you need to get working programs
    delivered fast, you should add Ruby to your toolbox.
  price: 49.50
  image_url: ruby.jpg

```

---

<div class="post-metadata">

**Author:** ![itsmegrave](https://forum.devtalk.com/user_avatar/forum.devtalk.com/itsmegrave/32/5401_2.png) [@itsmegrave](https://forum.devtalk.com/u/itsmegrave)\
**Post date:** [15 September 2023 18:14 UTC](https://forum.devtalk.com/t/agile-web-development-with-rails-7-test-in-iteration-c4-not-work/124627/2 "2023-09-15T18:14:46Z")

</div>

I discovered the problem. a typo on fixture 🤡  
just saw after I created the post. ☹
