While following the tutorial 5.3.4 Layout Link Tests failed.
This is the test ran:
'$ rails generate integration_test site_layout'.
This is the error received:
'/usr/local/rvm/gems/ruby-2.2.1/gems/fog-1.23.0/lib/fog/rackspace/mock_data.rb:42: warning: duplicated key at line 80 ignored: "name" /home/ubuntu/workspace/db/schema.rb doesn't exist yet. Run rake db:migrate to create it, then try again. If you do not intend to use a database, you should instead alter /home/ubuntu/workspace/config/application.rb to limit the frameworks that will be loaded. Started
FAIL["test_layout_links", SiteLayoutTest, 2015-05-10 20:31:00 +0000] test_layout_links#SiteLayoutTest (1431289860.34s) Expected exactly 2 elements matching "a[href="/"]", found 0.. Expected: 2 Actual: 0 test/integration/site_layout_test.rb:8:in `block in '
1/1: [====================================================================================================================] 100% Time: 00:00:00, Time: 00:00:00
Finished in 0.53147s 1 tests, 2 assertions, 1 failures, 0 errors, 0 skips'
This is the file changed prior to running the test and receiving the error:
Below are the contents of the file:
class SiteLayoutTest < ActionDispatch::IntegrationTest test "layout links" do get root_path assert_template 'static_pages/home' assert_select "a[href=?]", root_path, count: 2 assert_select "a[href=?]", help_path assert_select "a[href=?]", about_path assert_select "a[href=?]", contact_path # test "the truth" do # assert true end end What am I doing wrong? Where's my mistake? Please help.