Permalink
Browse files

Display notice in index.html pages in scaffolded generated views

As we are setting notice in destroy action we should display that

For more information see #14044
And rails/jbuilder#191

closes #14044
  • Loading branch information...
1 parent cce376c commit e197fd7f378815f3f56cac824b2926061fc17203 @arunagw arunagw committed Jul 4, 2014
@@ -1,3 +1,5 @@
+<p id="notice"><%%= notice %></p>
+
<h1>Listing <%= plural_table_name.titleize %></h1>
<table>
@@ -73,7 +73,7 @@ def test_add_routes
def test_skip_routes
run_generator ["account", "foo", "--skip-routes"]
assert_file "config/routes.rb" do |routes|
- assert_no_match /get 'account\/foo'/, routes
+ assert_no_match(/get 'account\/foo'/, routes)
end
end
@@ -93,6 +93,14 @@ def test_views_are_generated
assert_no_file "app/views/layouts/users.html.erb"
end
+ def test_index_page_have_notice
+ run_generator
+
+ %w(index show).each do |view|
+ assert_file "app/views/users/#{view}.html.erb", /notice/
+ end
+ end
+
def test_functional_tests
run_generator ["User", "name:string", "age:integer", "organization:references{polymorphic}"]

0 comments on commit e197fd7

Please sign in to comment.