forked from bofh/fetsite
fetzneditions
This commit is contained in:
22
spec/views/fetzneditions/edit.html.erb_spec.rb
Normal file
22
spec/views/fetzneditions/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fetzneditions/edit" do
|
||||
before(:each) do
|
||||
@fetznedition = assign(:fetznedition, stub_model(Fetznedition,
|
||||
:title => "MyString",
|
||||
:desc => "MyText",
|
||||
:datei => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit fetznedition form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form[action=?][method=?]", fetznedition_path(@fetznedition), "post" do
|
||||
assert_select "input#fetznedition_title[name=?]", "fetznedition[title]"
|
||||
assert_select "textarea#fetznedition_desc[name=?]", "fetznedition[desc]"
|
||||
assert_select "input#fetznedition_datei[name=?]", "fetznedition[datei]"
|
||||
end
|
||||
end
|
||||
end
|
||||
26
spec/views/fetzneditions/index.html.erb_spec.rb
Normal file
26
spec/views/fetzneditions/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,26 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fetzneditions/index" do
|
||||
before(:each) do
|
||||
assign(:fetzneditions, [
|
||||
stub_model(Fetznedition,
|
||||
:title => "Title",
|
||||
:desc => "MyText",
|
||||
:datei => "Datei"
|
||||
),
|
||||
stub_model(Fetznedition,
|
||||
:title => "Title",
|
||||
:desc => "MyText",
|
||||
:datei => "Datei"
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of fetzneditions" do
|
||||
render
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "tr>td", :text => "Title".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "MyText".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Datei".to_s, :count => 2
|
||||
end
|
||||
end
|
||||
22
spec/views/fetzneditions/new.html.erb_spec.rb
Normal file
22
spec/views/fetzneditions/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fetzneditions/new" do
|
||||
before(:each) do
|
||||
assign(:fetznedition, stub_model(Fetznedition,
|
||||
:title => "MyString",
|
||||
:desc => "MyText",
|
||||
:datei => "MyString"
|
||||
).as_new_record)
|
||||
end
|
||||
|
||||
it "renders new fetznedition form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form[action=?][method=?]", fetzneditions_path, "post" do
|
||||
assert_select "input#fetznedition_title[name=?]", "fetznedition[title]"
|
||||
assert_select "textarea#fetznedition_desc[name=?]", "fetznedition[desc]"
|
||||
assert_select "input#fetznedition_datei[name=?]", "fetznedition[datei]"
|
||||
end
|
||||
end
|
||||
end
|
||||
19
spec/views/fetzneditions/show.html.erb_spec.rb
Normal file
19
spec/views/fetzneditions/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fetzneditions/show" do
|
||||
before(:each) do
|
||||
@fetznedition = assign(:fetznedition, stub_model(Fetznedition,
|
||||
:title => "Title",
|
||||
:desc => "MyText",
|
||||
:datei => "Datei"
|
||||
))
|
||||
end
|
||||
|
||||
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(/Title/)
|
||||
rendered.should match(/MyText/)
|
||||
rendered.should match(/Datei/)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user