update specs for admin roles

This commit is contained in:
Brenda Wallace
2019-10-21 14:28:59 +13:00
parent 6280115055
commit 498a754eea
5 changed files with 7 additions and 8 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -10,7 +10,7 @@ describe "admin/roles/show" do
it "renders attributes in <p>" 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