forked from bofh/fetsite
a lot of new models ...
Fotogallary, gremien, fetprofil,
This commit is contained in:
20
spec/views/galleries/edit.html.erb_spec.rb
Normal file
20
spec/views/galleries/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "galleries/edit" do
|
||||
before(:each) do
|
||||
@gallery = assign(:gallery, stub_model(Gallery,
|
||||
:name => "MyString",
|
||||
:desc => "MyText"
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit gallery form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form[action=?][method=?]", gallery_path(@gallery), "post" do
|
||||
assert_select "input#gallery_name[name=?]", "gallery[name]"
|
||||
assert_select "textarea#gallery_desc[name=?]", "gallery[desc]"
|
||||
end
|
||||
end
|
||||
end
|
||||
23
spec/views/galleries/index.html.erb_spec.rb
Normal file
23
spec/views/galleries/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "galleries/index" do
|
||||
before(:each) do
|
||||
assign(:galleries, [
|
||||
stub_model(Gallery,
|
||||
:name => "Name",
|
||||
:desc => "MyText"
|
||||
),
|
||||
stub_model(Gallery,
|
||||
:name => "Name",
|
||||
:desc => "MyText"
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of galleries" do
|
||||
render
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "tr>td", :text => "Name".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "MyText".to_s, :count => 2
|
||||
end
|
||||
end
|
||||
20
spec/views/galleries/new.html.erb_spec.rb
Normal file
20
spec/views/galleries/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "galleries/new" do
|
||||
before(:each) do
|
||||
assign(:gallery, stub_model(Gallery,
|
||||
:name => "MyString",
|
||||
:desc => "MyText"
|
||||
).as_new_record)
|
||||
end
|
||||
|
||||
it "renders new gallery form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form[action=?][method=?]", galleries_path, "post" do
|
||||
assert_select "input#gallery_name[name=?]", "gallery[name]"
|
||||
assert_select "textarea#gallery_desc[name=?]", "gallery[desc]"
|
||||
end
|
||||
end
|
||||
end
|
||||
17
spec/views/galleries/show.html.erb_spec.rb
Normal file
17
spec/views/galleries/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "galleries/show" do
|
||||
before(:each) do
|
||||
@gallery = assign(:gallery, stub_model(Gallery,
|
||||
:name => "Name",
|
||||
:desc => "MyText"
|
||||
))
|
||||
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(/Name/)
|
||||
rendered.should match(/MyText/)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user