forked from bofh/fetsite
a lot of new models ...
Fotogallary, gremien, fetprofil,
This commit is contained in:
24
spec/views/fotos/edit.html.erb_spec.rb
Normal file
24
spec/views/fotos/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fotos/edit" do
|
||||
before(:each) do
|
||||
@foto = assign(:foto, stub_model(Foto,
|
||||
:title => "MyString",
|
||||
:desc => "MyText",
|
||||
:gallery_id => 1,
|
||||
:datei => "MyString"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit foto form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form[action=?][method=?]", foto_path(@foto), "post" do
|
||||
assert_select "input#foto_title[name=?]", "foto[title]"
|
||||
assert_select "textarea#foto_desc[name=?]", "foto[desc]"
|
||||
assert_select "input#foto_gallery_id[name=?]", "foto[gallery_id]"
|
||||
assert_select "input#foto_datei[name=?]", "foto[datei]"
|
||||
end
|
||||
end
|
||||
end
|
||||
29
spec/views/fotos/index.html.erb_spec.rb
Normal file
29
spec/views/fotos/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,29 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fotos/index" do
|
||||
before(:each) do
|
||||
assign(:fotos, [
|
||||
stub_model(Foto,
|
||||
:title => "Title",
|
||||
:desc => "MyText",
|
||||
:gallery_id => 1,
|
||||
:datei => "Datei"
|
||||
),
|
||||
stub_model(Foto,
|
||||
:title => "Title",
|
||||
:desc => "MyText",
|
||||
:gallery_id => 1,
|
||||
:datei => "Datei"
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of fotos" 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 => 1.to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Datei".to_s, :count => 2
|
||||
end
|
||||
end
|
||||
24
spec/views/fotos/new.html.erb_spec.rb
Normal file
24
spec/views/fotos/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fotos/new" do
|
||||
before(:each) do
|
||||
assign(:foto, stub_model(Foto,
|
||||
:title => "MyString",
|
||||
:desc => "MyText",
|
||||
:gallery_id => 1,
|
||||
:datei => "MyString"
|
||||
).as_new_record)
|
||||
end
|
||||
|
||||
it "renders new foto form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form[action=?][method=?]", fotos_path, "post" do
|
||||
assert_select "input#foto_title[name=?]", "foto[title]"
|
||||
assert_select "textarea#foto_desc[name=?]", "foto[desc]"
|
||||
assert_select "input#foto_gallery_id[name=?]", "foto[gallery_id]"
|
||||
assert_select "input#foto_datei[name=?]", "foto[datei]"
|
||||
end
|
||||
end
|
||||
end
|
||||
21
spec/views/fotos/show.html.erb_spec.rb
Normal file
21
spec/views/fotos/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fotos/show" do
|
||||
before(:each) do
|
||||
@foto = assign(:foto, stub_model(Foto,
|
||||
:title => "Title",
|
||||
:desc => "MyText",
|
||||
:gallery_id => 1,
|
||||
: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(/1/)
|
||||
rendered.should match(/Datei/)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user