annotate plugins/redmine_checkout/spec/models/protocol_spec.rb @ 1628:9c5f8e24dadc live tip

Quieten this cron script
author Chris Cannam
date Tue, 25 Aug 2020 11:38:49 +0100
parents b4b72f1eb644
children
rev   line source
Chris@16 1 require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
Chris@16 2
Chris@16 3 describe Checkout::Protocol do
Chris@16 4 fixtures :settings, :repositories, :projects, :enabled_modules
Chris@16 5
Chris@16 6 before(:each) do
Chris@16 7 @admin = User.new
Chris@16 8 @admin.admin = true
Chris@16 9 @user = User.new
Chris@16 10
Chris@16 11 @repo = repositories :svn
Chris@16 12 @repo.url = "http://example.com/svn/testrepo"
Chris@16 13 end
Chris@16 14
Chris@16 15 it "should use regexes for generated URL" do
Chris@16 16 protocol = @repo.checkout_protocols.find{|r| r.protocol == "SVN+SSH"}
Chris@16 17 protocol.url.should eql "svn+ssh://testrepo@svn.foo.bar/svn"
Chris@16 18 end
Chris@16 19
Chris@16 20 it "should resolve access properties" do
Chris@16 21 protocol = @repo.checkout_protocols.find{|r| r.protocol == "Subversion"}
Chris@16 22 protocol.access.should eql "permission"
Chris@16 23 protocol.access_rw(@admin).should eql "read+write"
Chris@16 24
Chris@16 25 User.current = @user
Chris@16 26 protocol.access_rw(@user).should eql "read-only"
Chris@16 27 end
Chris@16 28
Chris@16 29 it "should display the checkout command" do
Chris@16 30 subversion = @repo.checkout_protocols.find{|r| r.protocol == "Subversion"}
Chris@16 31 svn_ssh = @repo.checkout_protocols.find{|r| r.protocol == "SVN+SSH"}
Chris@16 32
Chris@16 33 subversion.command.should eql "svn checkout"
Chris@16 34 svn_ssh.command.should eql "svn co"
Chris@16 35 end
Chris@16 36 end