Mercurial > hg > soundsoftware-site
comparison plugins/redmine_checkout/spec/macros/macro_spec.rb @ 1117:b4b72f1eb644 redmine-2.2-integration
Moved all the plugins from the vendor folder to the application root folder.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Tue, 08 Jan 2013 12:32:05 +0000 |
parents | vendor/plugins/redmine_checkout/spec/macros/macro_spec.rb@020926a36823 |
children |
comparison
equal
deleted
inserted
replaced
1116:bb32da3bea34 | 1117:b4b72f1eb644 |
---|---|
1 require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') | |
2 | |
3 describe "Macros" do | |
4 fixtures :settings, :repositories, :projects, :enabled_modules | |
5 | |
6 include ERB::Util | |
7 include ApplicationHelper | |
8 include ActionView::Helpers::TextHelper | |
9 include ActionView::Helpers::TagHelper | |
10 include ActionView::Helpers::UrlHelper | |
11 | |
12 before(:each) do | |
13 Setting.checkout_display_command_Subversion = '0' | |
14 | |
15 @project = projects :projects_001 | |
16 end | |
17 | |
18 | |
19 it "should display default checkout url" do | |
20 text = "{{repository}}" | |
21 | |
22 url = "file:///#{RAILS_ROOT.gsub(%r{config\/\.\.}, '')}/tmp/test/subversion_repository" | |
23 textilizable(text).should eql "<p><a href=\"#{url}\">#{url}</a></p>" | |
24 end | |
25 | |
26 it "should display forced checkout url" do | |
27 text = "{{repository(svn+ssh)}}" | |
28 | |
29 url = 'svn+ssh://subversion_repository@svn.foo.bar/svn' | |
30 textilizable(text).should eql "<p><a href=\"#{url}\">#{url}</a></p>" | |
31 end | |
32 | |
33 it "should fail without set project" do | |
34 @project = nil | |
35 | |
36 text = "{{repository(svn+ssh)}}" | |
37 textilizable(text).should eql "<p><div class=\"flash error\">Error executing the <strong>repository</strong> macro (Checkout protocol svn+ssh not found)</div></p>" | |
38 end | |
39 | |
40 it "should display checkout url from stated project" do | |
41 @project = nil | |
42 text = "{{repository(ecookbook:svn+ssh)}}" | |
43 | |
44 url = 'svn+ssh://subversion_repository@svn.foo.bar/svn' | |
45 textilizable(text).should eql "<p><a href=\"#{url}\">#{url}</a></p>" | |
46 end | |
47 | |
48 it "should display command" do | |
49 Setting.checkout_display_command_Subversion = '1' | |
50 | |
51 text = "{{repository(svn+ssh)}}" | |
52 url = 'svn+ssh://subversion_repository@svn.foo.bar/svn' | |
53 textilizable(text).should eql "<p>svn co <a href=\"#{url}\">#{url}</a></p>" | |
54 end | |
55 end |