Sha256: be8cd9f36f5108e1191c26abb60e7ebc1188f1cb8a69cc5a7abb3a2b60ed1206

Contents?: true

Size: 711 Bytes

Versions: 6

Compression:

Stored size: 711 Bytes

Contents

module KuhsaftSpecHelper
  def set_lang lang
    @remember_translation_locale = Kuhsaft::Page.current_translation_locale
    Kuhsaft::Page.current_translation_locale = lang
  end
  
  def reset_lang
    Kuhsaft::Page.current_translation_locale = @remember_translation_locale if @remember_translation_locale.present?
  end
  
  def destroy_all_pages
    Kuhsaft::Page.all.each { |p| p.destroy }
    Kuhsaft::LocalizedPage.all.each { |p| p.destroy }
  end
  
  def create_page_tree
    page1 = Factory.create :page
    page2 = Factory.create :page
    page3 = Factory.create :page
    
    page1.childs << page2
    page1.save
    
    page2.childs << page3
    page2.save
    
    [page1, page2, page3]
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kuhsaft-0.1.1 spec/support/kuhsaft_spec_helper.rb
kuhsaft-0.1.0 spec/support/kuhsaft_spec_helper.rb
kuhsaft-0.0.8 spec/support/kuhsaft_spec_helper.rb
kuhsaft-0.0.7 spec/support/kuhsaft_spec_helper.rb
kuhsaft-0.0.6 spec/support/kuhsaft_spec_helper.rb
kuhsaft-0.0.5 spec/support/kuhsaft_spec_helper.rb