Update specs for attribute change and rich text
This commit is contained in:
@@ -4,7 +4,7 @@ RSpec.describe "articles/edit", type: :view do
|
|||||||
before(:each) do
|
before(:each) do
|
||||||
@article = assign(:article, Article.create!(
|
@article = assign(:article, Article.create!(
|
||||||
title: "MyString",
|
title: "MyString",
|
||||||
text: "MyText"
|
content: "MyContent"
|
||||||
))
|
))
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -15,7 +15,8 @@ RSpec.describe "articles/edit", type: :view do
|
|||||||
|
|
||||||
assert_select "input[name=?]", "article[title]"
|
assert_select "input[name=?]", "article[title]"
|
||||||
|
|
||||||
assert_select "textarea[name=?]", "article[text]"
|
#TODO: with rich_text, this is not a textarea
|
||||||
|
# assert_select "textarea[name=?]", "article[content]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ RSpec.describe "articles/index", type: :view do
|
|||||||
assign(:articles, [
|
assign(:articles, [
|
||||||
Article.create!(
|
Article.create!(
|
||||||
title: "Title",
|
title: "Title",
|
||||||
text: "MyText"
|
content: "MyText"
|
||||||
),
|
),
|
||||||
Article.create!(
|
Article.create!(
|
||||||
title: "Title",
|
title: "Title",
|
||||||
text: "MyText"
|
content: "MyText"
|
||||||
)
|
)
|
||||||
])
|
])
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ RSpec.describe "articles/new", type: :view do
|
|||||||
before(:each) do
|
before(:each) do
|
||||||
assign(:article, Article.new(
|
assign(:article, Article.new(
|
||||||
title: "MyString",
|
title: "MyString",
|
||||||
text: "MyText"
|
content: "MyContent"
|
||||||
))
|
))
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -15,7 +15,8 @@ RSpec.describe "articles/new", type: :view do
|
|||||||
|
|
||||||
assert_select "input[name=?]", "article[title]"
|
assert_select "input[name=?]", "article[title]"
|
||||||
|
|
||||||
assert_select "textarea[name=?]", "article[text]"
|
#TODO: with rich_text, this is not a textarea
|
||||||
|
# assert_select "textarea[name=?]", "article[content]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ RSpec.describe "articles/show", type: :view do
|
|||||||
before(:each) do
|
before(:each) do
|
||||||
@article = assign(:article, Article.create!(
|
@article = assign(:article, Article.create!(
|
||||||
title: "Title",
|
title: "Title",
|
||||||
text: "MyText"
|
content: "MyContent"
|
||||||
))
|
))
|
||||||
end
|
end
|
||||||
|
|
||||||
it "renders attributes in <p>" do
|
it "renders attributes in <p>" do
|
||||||
render
|
render
|
||||||
expect(rendered).to match(/Title/)
|
expect(rendered).to match(/Title/)
|
||||||
expect(rendered).to match(/MyText/)
|
expect(rendered).to match(/MyContent/)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user