From 194a8375ddbf5d62419c67496e9fa56515c2d3fa Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Wed, 2 Sep 2015 22:03:01 +0200 Subject: [PATCH] AutoCommit Mit Sep 2 22:03:01 CEST 2015 --- spec/factories/fetprofiles.rb | 9 ++++++ spec/views/fetprofiles/index.html.erb_spec.rb | 32 +++++++------------ 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/spec/factories/fetprofiles.rb b/spec/factories/fetprofiles.rb index 07decc8..ec37f92 100644 --- a/spec/factories/fetprofiles.rb +++ b/spec/factories/fetprofiles.rb @@ -11,6 +11,15 @@ FactoryGirl.define do active false birth_month 4 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 street "some street" plz "1231" diff --git a/spec/views/fetprofiles/index.html.erb_spec.rb b/spec/views/fetprofiles/index.html.erb_spec.rb index 34593da..a00e9bd 100644 --- a/spec/views/fetprofiles/index.html.erb_spec.rb +++ b/spec/views/fetprofiles/index.html.erb_spec.rb @@ -1,32 +1,22 @@ 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 - ) - ]) + default_url_options[:locale] = :de + fetprofile1 = FactoryGirl.create(:fetprofile) + fetprofile2 = FactoryGirl.create(:fetprofile2) + fetprofile3 = FactoryGirl.create(:fetprofile3) + fetprofile4 = FactoryGirl.create(:fetprofile_withadress) + @fetprofiles=[fetprofile1, fetprofile2, fetprofile3, fetprofile4] + assign(:fetprofiles,@fetprofiles) + 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