AutoCommit Don Sep 3 12:03:05 CEST 2015
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||
|
||||
FactoryGirl.define do
|
||||
factory :gremium do
|
||||
name "MyString"
|
||||
desc "MyText"
|
||||
typ "MyString"
|
||||
name "Kommission"
|
||||
desc "Das ist eine Kommission die sich mit irgendwas beschäftigt"
|
||||
typ 1
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
FactoryGirl.define do
|
||||
factory :membership do
|
||||
fetprofile_id "MyString"
|
||||
gremium_id "MyString"
|
||||
fetprofile_id 1
|
||||
gremium_id 1
|
||||
start "2013-08-19"
|
||||
stop "2013-08-19"
|
||||
typ "MyString"
|
||||
stop "2013-08-23"
|
||||
typ 1
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,8 +13,12 @@ describe "fetprofiles/show", :type => :view do
|
||||
default_url_options[:locale] = :de
|
||||
@fetprofile = FactoryGirl.create(:fetprofile_withadress)
|
||||
assign(:fetprofile,@fetprofile)
|
||||
assign(:memberships, [])
|
||||
assign(:gremientabs, [])
|
||||
@gremium = FactoryGirl.create(:gremium)
|
||||
@gremium2 = FactoryGirl.create(:gremium, name:"Kommission2")
|
||||
@gremium3 = FactoryGirl.create(:gremium, name:"Kommission3", typ: 2)
|
||||
|
||||
assign(:memberships, [FactoryGirl.create(:membership,gremium_id: @gremium.id, fetprofile_id: @fetprofile.id)])
|
||||
assign(:gremientabs, [@gremium2])
|
||||
# view.theme "blue2"
|
||||
end
|
||||
def self.login_fet_user
|
||||
@@ -82,6 +86,19 @@ end
|
||||
expect(rendered).not_to match(/#{@fetprofile.plz}/)
|
||||
|
||||
end
|
||||
it "renders links to gremium" do
|
||||
render
|
||||
expect(rendered).to match(/#{gremium_path(@gremium)}/)
|
||||
end
|
||||
it "renders gremium links" do
|
||||
render
|
||||
expect(rendered).to match(/#{gremium_path(@gremium2)}/)
|
||||
end
|
||||
it "doesn't render gremium links for hidden gremium" do
|
||||
render
|
||||
expect(rendered).not_to match(/#{gremium_path(@gremium3)}/)
|
||||
end
|
||||
|
||||
describe "with fet user" do
|
||||
login_fet_user
|
||||
|
||||
|
||||
Reference in New Issue
Block a user