From 11be92e4bac671852fd03922049ca592ae4c9f4e Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Sat, 1 Mar 2014 20:24:43 -0500 Subject: changed the gemfile to include rspecy testing and a security name i cant remember the name of --- spec/views/alerts/new.html.erb_spec.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 spec/views/alerts/new.html.erb_spec.rb (limited to 'spec/views/alerts/new.html.erb_spec.rb') diff --git a/spec/views/alerts/new.html.erb_spec.rb b/spec/views/alerts/new.html.erb_spec.rb new file mode 100644 index 0000000..e38cbd3 --- /dev/null +++ b/spec/views/alerts/new.html.erb_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe "alerts/new" do + before(:each) do + assign(:alert, stub_model(Alert, + :author => nil, + :message => "MyText" + ).as_new_record) + end + + it "renders new alert form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form[action=?][method=?]", alerts_path, "post" do + assert_select "input#alert_author[name=?]", "alert[author]" + assert_select "textarea#alert_message[name=?]", "alert[message]" + end + end +end -- cgit v1.2.3-2-g168b