comparison plugins/redmine_checkout/spec/models/protocol_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 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