forked from bofh/fetsite
a lot of new models ...
Fotogallary, gremien, fetprofil,
This commit is contained in:
30
spec/views/fetprofiles/edit.html.erb_spec.rb
Normal file
30
spec/views/fetprofiles/edit.html.erb_spec.rb
Normal file
@@ -0,0 +1,30 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fetprofiles/edit" do
|
||||
before(:each) do
|
||||
@fetprofile = assign(:fetprofile, stub_model(Fetprofile,
|
||||
:vorname => "MyString",
|
||||
:nachname => "MyString",
|
||||
:short => "MyString",
|
||||
:fetmailalias => "MyString",
|
||||
:desc => "MyText",
|
||||
:picture => "MyString",
|
||||
:active => false
|
||||
))
|
||||
end
|
||||
|
||||
it "renders the edit fetprofile form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form[action=?][method=?]", fetprofile_path(@fetprofile), "post" do
|
||||
assert_select "input#fetprofile_vorname[name=?]", "fetprofile[vorname]"
|
||||
assert_select "input#fetprofile_nachname[name=?]", "fetprofile[nachname]"
|
||||
assert_select "input#fetprofile_short[name=?]", "fetprofile[short]"
|
||||
assert_select "input#fetprofile_fetmailalias[name=?]", "fetprofile[fetmailalias]"
|
||||
assert_select "textarea#fetprofile_desc[name=?]", "fetprofile[desc]"
|
||||
assert_select "input#fetprofile_picture[name=?]", "fetprofile[picture]"
|
||||
assert_select "input#fetprofile_active[name=?]", "fetprofile[active]"
|
||||
end
|
||||
end
|
||||
end
|
||||
38
spec/views/fetprofiles/index.html.erb_spec.rb
Normal file
38
spec/views/fetprofiles/index.html.erb_spec.rb
Normal file
@@ -0,0 +1,38 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fetprofiles/index" do
|
||||
before(:each) do
|
||||
assign(:fetprofiles, [
|
||||
stub_model(Fetprofile,
|
||||
:vorname => "Vorname",
|
||||
:nachname => "Nachname",
|
||||
:short => "Short",
|
||||
:fetmailalias => "Fetmailalias",
|
||||
:desc => "MyText",
|
||||
:picture => "Picture",
|
||||
:active => false
|
||||
),
|
||||
stub_model(Fetprofile,
|
||||
:vorname => "Vorname",
|
||||
:nachname => "Nachname",
|
||||
:short => "Short",
|
||||
:fetmailalias => "Fetmailalias",
|
||||
:desc => "MyText",
|
||||
:picture => "Picture",
|
||||
:active => false
|
||||
)
|
||||
])
|
||||
end
|
||||
|
||||
it "renders a list of fetprofiles" do
|
||||
render
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "tr>td", :text => "Vorname".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Nachname".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Short".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Fetmailalias".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "MyText".to_s, :count => 2
|
||||
assert_select "tr>td", :text => "Picture".to_s, :count => 2
|
||||
assert_select "tr>td", :text => false.to_s, :count => 2
|
||||
end
|
||||
end
|
||||
30
spec/views/fetprofiles/new.html.erb_spec.rb
Normal file
30
spec/views/fetprofiles/new.html.erb_spec.rb
Normal file
@@ -0,0 +1,30 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fetprofiles/new" do
|
||||
before(:each) do
|
||||
assign(:fetprofile, stub_model(Fetprofile,
|
||||
:vorname => "MyString",
|
||||
:nachname => "MyString",
|
||||
:short => "MyString",
|
||||
:fetmailalias => "MyString",
|
||||
:desc => "MyText",
|
||||
:picture => "MyString",
|
||||
:active => false
|
||||
).as_new_record)
|
||||
end
|
||||
|
||||
it "renders new fetprofile form" do
|
||||
render
|
||||
|
||||
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
||||
assert_select "form[action=?][method=?]", fetprofiles_path, "post" do
|
||||
assert_select "input#fetprofile_vorname[name=?]", "fetprofile[vorname]"
|
||||
assert_select "input#fetprofile_nachname[name=?]", "fetprofile[nachname]"
|
||||
assert_select "input#fetprofile_short[name=?]", "fetprofile[short]"
|
||||
assert_select "input#fetprofile_fetmailalias[name=?]", "fetprofile[fetmailalias]"
|
||||
assert_select "textarea#fetprofile_desc[name=?]", "fetprofile[desc]"
|
||||
assert_select "input#fetprofile_picture[name=?]", "fetprofile[picture]"
|
||||
assert_select "input#fetprofile_active[name=?]", "fetprofile[active]"
|
||||
end
|
||||
end
|
||||
end
|
||||
27
spec/views/fetprofiles/show.html.erb_spec.rb
Normal file
27
spec/views/fetprofiles/show.html.erb_spec.rb
Normal file
@@ -0,0 +1,27 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe "fetprofiles/show" do
|
||||
before(:each) do
|
||||
@fetprofile = assign(:fetprofile, stub_model(Fetprofile,
|
||||
:vorname => "Vorname",
|
||||
:nachname => "Nachname",
|
||||
:short => "Short",
|
||||
:fetmailalias => "Fetmailalias",
|
||||
:desc => "MyText",
|
||||
:picture => "Picture",
|
||||
:active => false
|
||||
))
|
||||
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(/Vorname/)
|
||||
rendered.should match(/Nachname/)
|
||||
rendered.should match(/Short/)
|
||||
rendered.should match(/Fetmailalias/)
|
||||
rendered.should match(/MyText/)
|
||||
rendered.should match(/Picture/)
|
||||
rendered.should match(/false/)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user