diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-07-08 03:49:40 -0700 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-07-08 03:49:40 -0700 |
commit | 05e2c4359d1f1e8addb33d6cb1980bc6dedf8bbd (patch) | |
tree | 6b05858d45dc74a6777f1d7d61a64295811812c7 /spec/gitlab_projects_spec.rb | |
parent | e049749a06831b87435bc41d108755fcc75679cf (diff) | |
parent | 66cfc50fcde2d13b56e774db49b71ff38e057008 (diff) | |
download | gitlab-shell-05e2c4359d1f1e8addb33d6cb1980bc6dedf8bbd.tar.gz |
Merge pull request #69 from thomasbiddle/support_adding_and_removing_branches_and_tags
Support adding and removing branches and tags
Diffstat (limited to 'spec/gitlab_projects_spec.rb')
-rw-r--r-- | spec/gitlab_projects_spec.rb | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/spec/gitlab_projects_spec.rb b/spec/gitlab_projects_spec.rb index ba8187e..1c02430 100644 --- a/spec/gitlab_projects_spec.rb +++ b/spec/gitlab_projects_spec.rb @@ -22,6 +22,74 @@ describe GitlabProjects do it { @gl_projects.instance_variable_get(:@full_path).should == "#{GitlabConfig.new.repos_path}/gitlab-ci.git" } end + describe :create_branch do + let(:gl_projects_create) { + build_gitlab_projects('import-project', repo_name, 'https://github.com/randx/six.git') + } + let(:gl_projects) { build_gitlab_projects('create-branch', repo_name, 'test_branch', 'master') } + + it "should create a branch" do + gl_projects_create.exec + gl_projects.exec + branch_ref = `cd #{tmp_repo_path} && git rev-parse test_branch`.strip + master_ref = `cd #{tmp_repo_path} && git rev-parse master`.strip + branch_ref.should == master_ref + end + end + + describe :rm_branch do + let(:gl_projects_create) { + build_gitlab_projects('import-project', repo_name, 'https://github.com/randx/six.git') + } + let(:gl_projects_create_branch) { + build_gitlab_projects('create-branch', repo_name, 'test_branch', 'master') + } + let(:gl_projects) { build_gitlab_projects('rm-branch', repo_name, 'test_branch') } + + it "should remove a branch" do + gl_projects_create.exec + gl_projects_create_branch.exec + branch_ref = `cd #{tmp_repo_path} && git rev-parse test_branch`.strip + gl_projects.exec + branch_del = `cd #{tmp_repo_path} && git rev-parse test_branch`.strip + branch_del.should_not == branch_ref + end + end + + describe :create_tag do + let(:gl_projects_create) { + build_gitlab_projects('import-project', repo_name, 'https://github.com/randx/six.git') + } + let(:gl_projects) { build_gitlab_projects('create-tag', repo_name, 'test_tag', 'master') } + + it "should create a tag" do + gl_projects_create.exec + gl_projects.exec + tag_ref = `cd #{tmp_repo_path} && git rev-parse test_tag`.strip + master_ref = `cd #{tmp_repo_path} && git rev-parse master`.strip + tag_ref.should == master_ref + end + end + + describe :rm_tag do + let(:gl_projects_create) { + build_gitlab_projects('import-project', repo_name, 'https://github.com/randx/six.git') + } + let(:gl_projects_create_tag) { + build_gitlab_projects('create-tag', repo_name, 'test_tag', 'master') + } + let(:gl_projects) { build_gitlab_projects('rm-tag', repo_name, 'test_tag') } + + it "should remove a branch" do + gl_projects_create.exec + gl_projects_create_tag.exec + branch_ref = `cd #{tmp_repo_path} && git rev-parse test_tag`.strip + gl_projects.exec + branch_del = `cd #{tmp_repo_path} && git rev-parse test_tag`.strip + branch_del.should_not == branch_ref + end + end + describe :add_project do let(:gl_projects) { build_gitlab_projects('add-project', repo_name) } |