Mercurial > hg > soundsoftware-site
comparison plugins/redmine_checkout/spec/models/protocol_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/models/protocol_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 Checkout::Protocol do | |
4 fixtures :settings, :repositories, :projects, :enabled_modules | |
5 | |
6 before(:each) do | |
7 @admin = User.new | |
8 @admin.admin = true | |
9 @user = User.new | |
10 | |
11 @repo = repositories :svn | |
12 @repo.url = "http://example.com/svn/testrepo" | |
13 end | |
14 | |
15 it "should use regexes for generated URL" do | |
16 protocol = @repo.checkout_protocols.find{|r| r.protocol == "SVN+SSH"} | |
17 protocol.url.should eql "svn+ssh://testrepo@svn.foo.bar/svn" | |
18 end | |
19 | |
20 it "should resolve access properties" do | |
21 protocol = @repo.checkout_protocols.find{|r| r.protocol == "Subversion"} | |
22 protocol.access.should eql "permission" | |
23 protocol.access_rw(@admin).should eql "read+write" | |
24 | |
25 User.current = @user | |
26 protocol.access_rw(@user).should eql "read-only" | |
27 end | |
28 | |
29 it "should display the checkout command" do | |
30 subversion = @repo.checkout_protocols.find{|r| r.protocol == "Subversion"} | |
31 svn_ssh = @repo.checkout_protocols.find{|r| r.protocol == "SVN+SSH"} | |
32 | |
33 subversion.command.should eql "svn checkout" | |
34 svn_ssh.command.should eql "svn co" | |
35 end | |
36 end |