From 498a754eeaf8d7c526a1a1a0de455baf42684bb3 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 21 Oct 2019 14:28:59 +1300 Subject: [PATCH] update specs for admin roles --- spec/views/admin/index_spec.rb | 4 ++-- spec/views/admin/newsletter_spec.rb | 2 +- spec/views/admin/roles/edit.html.haml_spec.rb | 3 +-- spec/views/admin/roles/new.html.haml_spec.rb | 2 +- spec/views/admin/roles/show.html.haml_spec.rb | 4 ++-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/spec/views/admin/index_spec.rb b/spec/views/admin/index_spec.rb index 7e8c27fdc..e1efb6fbc 100644 --- a/spec/views/admin/index_spec.rb +++ b/spec/views/admin/index_spec.rb @@ -9,11 +9,11 @@ describe 'admin/index.html.haml', type: "view" do end it "includes links to manage various things" do - assert_select "a", href: roles_path + assert_select "a", href: admin_roles_path assert_select "a", href: forums_path end it "has a link to newsletter subscribers" do - rendered.should have_content "Newsletter subscribers" + expeect(rendered).to have_content "Newsletter subscribers" end end diff --git a/spec/views/admin/newsletter_spec.rb b/spec/views/admin/newsletter_spec.rb index 4807aaa8e..fbae64def 100644 --- a/spec/views/admin/newsletter_spec.rb +++ b/spec/views/admin/newsletter_spec.rb @@ -11,6 +11,6 @@ describe 'admin/newsletter.html.haml', type: "view" do end it "lists newsletter subscribers by email" do - rendered.should have_content @subscriber.email + expect(rendered).to have_content @subscriber.email end end diff --git a/spec/views/admin/roles/edit.html.haml_spec.rb b/spec/views/admin/roles/edit.html.haml_spec.rb index 5976faebe..62dfaf3b3 100644 --- a/spec/views/admin/roles/edit.html.haml_spec.rb +++ b/spec/views/admin/roles/edit.html.haml_spec.rb @@ -10,8 +10,7 @@ describe "admin/roles/edit" do it "renders the edit role form" do render - # Run the generator again with the --webrat flag if you want to use webrat matchers - assert_select "form", action: roles_path(@role), method: "post" do + assert_select "form", action: admin_roles_path(@role), method: "post" do assert_select "input#role_name", name: "role[name]" assert_select "textarea#role_description", name: "role[description]" end diff --git a/spec/views/admin/roles/new.html.haml_spec.rb b/spec/views/admin/roles/new.html.haml_spec.rb index 4b439aded..6c27927f2 100644 --- a/spec/views/admin/roles/new.html.haml_spec.rb +++ b/spec/views/admin/roles/new.html.haml_spec.rb @@ -11,7 +11,7 @@ describe "admin/roles/new" do render # Run the generator again with the --webrat flag if you want to use webrat matchers - assert_select "form", action: roles_path, method: "post" do + assert_select "form", action: admin_roles_path, method: "post" do assert_select "input#role_name", name: "role[name]" assert_select "textarea#role_description", name: "role[description]" end diff --git a/spec/views/admin/roles/show.html.haml_spec.rb b/spec/views/admin/roles/show.html.haml_spec.rb index 23caef8b0..ee0a01c6a 100644 --- a/spec/views/admin/roles/show.html.haml_spec.rb +++ b/spec/views/admin/roles/show.html.haml_spec.rb @@ -10,7 +10,7 @@ describe "admin/roles/show" do it "renders attributes in

" do render # Run the generator again with the --webrat flag if you want to use webrat matchers - rendered.should match(/Name/) - rendered.should match(/MyText/) + expect(rendered).to match(/Name/) + expect(rendered).to match(/MyText/) end end