forked from bofh/fetsite
AutoCommit Mit Sep 2 22:03:01 CEST 2015
This commit is contained in:
@@ -11,6 +11,15 @@ FactoryGirl.define do
|
|||||||
active false
|
active false
|
||||||
birth_month 4
|
birth_month 4
|
||||||
birth_day 2
|
birth_day 2
|
||||||
|
factory :fetprofile2 do
|
||||||
|
vorname "Sarah"
|
||||||
|
nachname "Nachname2"
|
||||||
|
short "j"
|
||||||
|
end
|
||||||
|
factory :fetprofile3 do
|
||||||
|
vorname "Thomas"
|
||||||
|
nachname "Mustermann"
|
||||||
|
end
|
||||||
factory :fetprofile_withadress do
|
factory :fetprofile_withadress do
|
||||||
street "some street"
|
street "some street"
|
||||||
plz "1231"
|
plz "1231"
|
||||||
|
|||||||
@@ -1,32 +1,22 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
|
|
||||||
describe "fetprofiles/index" do
|
describe "fetprofiles/index" do
|
||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
assign(:fetprofiles, [
|
default_url_options[:locale] = :de
|
||||||
stub_model(Fetprofile,
|
fetprofile1 = FactoryGirl.create(:fetprofile)
|
||||||
:vorname => "Vorname",
|
fetprofile2 = FactoryGirl.create(:fetprofile2)
|
||||||
:nachname => "Nachname",
|
fetprofile3 = FactoryGirl.create(:fetprofile3)
|
||||||
:short => "Short",
|
fetprofile4 = FactoryGirl.create(:fetprofile_withadress)
|
||||||
:fetmailalias => "Fetmailalias",
|
@fetprofiles=[fetprofile1, fetprofile2, fetprofile3, fetprofile4]
|
||||||
:desc => "MyText",
|
assign(:fetprofiles,@fetprofiles)
|
||||||
:picture => "Picture",
|
|
||||||
:active => false
|
|
||||||
),
|
|
||||||
stub_model(Fetprofile,
|
|
||||||
:vorname => "Vorname",
|
|
||||||
:nachname => "Nachname",
|
|
||||||
:short => "Short",
|
|
||||||
:fetmailalias => "Fetmailalias",
|
|
||||||
:desc => "MyText",
|
|
||||||
:picture => "Picture",
|
|
||||||
:active => false
|
|
||||||
)
|
|
||||||
])
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it "renders a list of fetprofiles" do
|
it "renders a list of fetprofiles" do
|
||||||
render
|
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 => "Vorname".to_s, :count => 2
|
||||||
assert_select "tr>td", :text => "Nachname".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 => "Short".to_s, :count => 2
|
||||||
|
|||||||
Reference in New Issue
Block a user