comparison vendor/plugins/redmine_checkout/spec/models/protocol_spec.rb @ 16:020926a36823 yuya

* Add redmine-checkout plugin (as of svn rev 179 of the plugin)
author Chris Cannam
date Wed, 25 Aug 2010 16:39:01 +0100
parents
children
comparison
equal deleted inserted replaced
15:9c6c72729d91 16:020926a36823
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