dir = File.expand_path(File.dirname(__FILE__)) require "#{dir}/helper" CORE_CASES = %w{aspects basic folder items list page selector} SPECIAL_CASES = %w{user style} THEME_LAYOUTS = { :default => [[:home, :default], [:style, :default], [:blog, :default], [:post, :default]], :simple_organization => [[:home, :home], [:style, :default], [:blog, :default], [:post, :default]] } describe "Common Interface" do with_environment with_http before :all do load 'crystal/profiles/web.rb' end it "should display general help page" do wcall '/common_interface/demo/basic/help' # response.should be_success end end AbstractInterface.available_themes.each do |theme_name| describe ":#{theme_name} theme" do with_environment with_http before :all do load 'crystal/profiles/web.rb' end (CORE_CASES + SPECIAL_CASES).each do |action_name| it "should display :#{action_name}" do wcall "/common_interface/demo/basic/#{action_name}", :_theme => theme_name # response.should be_success end end it "should display help page" do wcall "/common_interface/demo/basic/help", :_theme => theme_name # response.should be_success end end describe ":#{theme_name} Theme for Site" do with_environment with_http before :all do load 'crystal/profiles/web.rb' end THEME_LAYOUTS[theme_name.to_sym].each do |action_name, ltemplate| it "should display :#{action_name}" do wcall "/common_interface/demo/site/#{action_name}", :_theme => theme_name, :_layout_template => ltemplate # response.should be_success end end end end