From 4214749ec115dff0124817057d8d926e80067f19 Mon Sep 17 00:00:00 2001 From: Ben Purinton Date: Thu, 6 Apr 2023 13:14:41 -0800 Subject: [PATCH] link_to spec --- spec/helper_methods/2_helper_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 spec/helper_methods/2_helper_spec.rb diff --git a/spec/helper_methods/2_helper_spec.rb b/spec/helper_methods/2_helper_spec.rb new file mode 100644 index 0000000..2b5c802 --- /dev/null +++ b/spec/helper_methods/2_helper_spec.rb @@ -0,0 +1,11 @@ +require "rails_helper" + +describe "movies/index" do + it "uses an embedded Ruby link_to helper method", points: 2 do + template_name = "movies/index.html.erb" + template_path = Rails.root.join('app', 'views', template_name) + template_contents = open(template_path).read + expect(template_contents).to match(/<%=.*link_to.*Add a new movie.*%>/), + "Expected to find `link_to` method with text 'Add a new movie' in movies/index.html.erb" + end +end