Mercurial > hg > soundsoftware-site
comparison plugins/redmine_checkout/spec/controllers/repositories_controller_spec.rb @ 1484:51364c0cd58f redmine-2.4-integration
Merge from live branch. Still need to merge manually in files overridden by plugins.
author | Chris Cannam |
---|---|
date | Wed, 15 Jan 2014 09:59:14 +0000 |
parents | b4b72f1eb644 |
children |
comparison
equal
deleted
inserted
replaced
1464:261b3d9a4903 | 1484:51364c0cd58f |
---|---|
1 require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') | |
2 | |
3 describe RepositoriesController do | |
4 fixtures :settings, :repositories, :projects, :roles, :users, :enabled_modules | |
5 integrate_views | |
6 | |
7 before(:each) do | |
8 Setting.default_language = 'en' | |
9 User.current = nil | |
10 end | |
11 | |
12 def get_repo | |
13 get :show, :id => 1 | |
14 end | |
15 | |
16 it "should display the protocol selector" do | |
17 get_repo | |
18 response.should be_success | |
19 response.should render_template('show') | |
20 | |
21 response.should have_tag('ul#checkout_protocols') do | |
22 with_tag('a[id=?][href=?]', 'checkout_protocol_subversion', "file:///#{RAILS_ROOT.gsub(%r{config\/\.\.}, '')}/tmp/test/subversion_repository") | |
23 with_tag('a[id=?][href=?]', 'checkout_protocol_svn+ssh', 'svn+ssh://subversion_repository@svn.foo.bar/svn') | |
24 end | |
25 end | |
26 | |
27 it "should display the description" do | |
28 get_repo | |
29 response.should be_success | |
30 response.should render_template('show') | |
31 | |
32 response.should have_tag('div.repository-info', /Please select the desired protocol below to get the URL/) | |
33 end | |
34 | |
35 it 'should respect the use zero clipboard option' do | |
36 Setting.checkout_use_zero_clipboard = '1' | |
37 get_repo | |
38 response.should be_success | |
39 response.should render_template('show') | |
40 response.should have_tag('script[src*=?]', 'ZeroClipboard') | |
41 | |
42 Setting.checkout_use_zero_clipboard = '0' | |
43 get_repo | |
44 response.should be_success | |
45 response.should render_template('show') | |
46 response.should_not have_tag('script[src*=]', 'ZeroClipboard') | |
47 end | |
48 end |