Chris@16: require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') Chris@16: Chris@16: describe RepositoriesController do Chris@16: fixtures :settings, :repositories, :projects, :roles, :users, :enabled_modules Chris@16: integrate_views Chris@16: Chris@16: before(:each) do Chris@16: Setting.default_language = 'en' Chris@16: User.current = nil Chris@16: end Chris@16: Chris@16: def get_repo Chris@16: get :show, :id => 1 Chris@16: end Chris@16: Chris@16: it "should display the protocol selector" do Chris@16: get_repo Chris@16: response.should be_success Chris@16: response.should render_template('show') Chris@16: Chris@16: response.should have_tag('ul#checkout_protocols') do Chris@16: with_tag('a[id=?][href=?]', 'checkout_protocol_subversion', "file:///#{RAILS_ROOT.gsub(%r{config\/\.\.}, '')}/tmp/test/subversion_repository") Chris@16: with_tag('a[id=?][href=?]', 'checkout_protocol_svn+ssh', 'svn+ssh://subversion_repository@svn.foo.bar/svn') Chris@16: end Chris@16: end Chris@16: Chris@16: it "should display the description" do Chris@16: get_repo Chris@16: response.should be_success Chris@16: response.should render_template('show') Chris@16: Chris@16: response.should have_tag('div.repository-info', /Please select the desired protocol below to get the URL/) Chris@16: end Chris@16: Chris@16: it 'should respect the use zero clipboard option' do Chris@16: Setting.checkout_use_zero_clipboard = '1' Chris@16: get_repo Chris@16: response.should be_success Chris@16: response.should render_template('show') Chris@16: response.should have_tag('script[src*=?]', 'ZeroClipboard') Chris@16: Chris@16: Setting.checkout_use_zero_clipboard = '0' Chris@16: get_repo Chris@16: response.should be_success Chris@16: response.should render_template('show') Chris@16: response.should_not have_tag('script[src*=]', 'ZeroClipboard') Chris@16: end Chris@16: end