annotate plugins/redmine_checkout/spec/controllers/repositories_controller_spec.rb @ 1621:3a510bf6a9bc

Merge from live branch
author Chris Cannam
date Fri, 13 Jul 2018 10:44:33 +0100
parents b4b72f1eb644
children
rev   line source
Chris@16 1 require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
Chris@16 2
Chris@16 3 describe RepositoriesController do
Chris@16 4 fixtures :settings, :repositories, :projects, :roles, :users, :enabled_modules
Chris@16 5 integrate_views
Chris@16 6
Chris@16 7 before(:each) do
Chris@16 8 Setting.default_language = 'en'
Chris@16 9 User.current = nil
Chris@16 10 end
Chris@16 11
Chris@16 12 def get_repo
Chris@16 13 get :show, :id => 1
Chris@16 14 end
Chris@16 15
Chris@16 16 it "should display the protocol selector" do
Chris@16 17 get_repo
Chris@16 18 response.should be_success
Chris@16 19 response.should render_template('show')
Chris@16 20
Chris@16 21 response.should have_tag('ul#checkout_protocols') do
Chris@16 22 with_tag('a[id=?][href=?]', 'checkout_protocol_subversion', "file:///#{RAILS_ROOT.gsub(%r{config\/\.\.}, '')}/tmp/test/subversion_repository")
Chris@16 23 with_tag('a[id=?][href=?]', 'checkout_protocol_svn+ssh', 'svn+ssh://subversion_repository@svn.foo.bar/svn')
Chris@16 24 end
Chris@16 25 end
Chris@16 26
Chris@16 27 it "should display the description" do
Chris@16 28 get_repo
Chris@16 29 response.should be_success
Chris@16 30 response.should render_template('show')
Chris@16 31
Chris@16 32 response.should have_tag('div.repository-info', /Please select the desired protocol below to get the URL/)
Chris@16 33 end
Chris@16 34
Chris@16 35 it 'should respect the use zero clipboard option' do
Chris@16 36 Setting.checkout_use_zero_clipboard = '1'
Chris@16 37 get_repo
Chris@16 38 response.should be_success
Chris@16 39 response.should render_template('show')
Chris@16 40 response.should have_tag('script[src*=?]', 'ZeroClipboard')
Chris@16 41
Chris@16 42 Setting.checkout_use_zero_clipboard = '0'
Chris@16 43 get_repo
Chris@16 44 response.should be_success
Chris@16 45 response.should render_template('show')
Chris@16 46 response.should_not have_tag('script[src*=]', 'ZeroClipboard')
Chris@16 47 end
Chris@16 48 end