diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-31 19:35:07 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-31 19:35:07 +0300 |
commit | 61f70334efa3ff4a2eda4a1d29c2ee59ecb82721 (patch) | |
tree | cd6117c491c3de7a128d2e486ad7c08b794782dd | |
parent | b238b1544c391bbc60a7d38c30d98e05be786667 (diff) | |
download | gitlab-ce-61f70334efa3ff4a2eda4a1d29c2ee59ecb82721.tar.gz |
Cleanup test dir before install gitlab-shell. Fix fork test scenario
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r-- | features/steps/project/fork.rb | 10 | ||||
-rw-r--r-- | spec/support/test_env.rb | 6 |
2 files changed, 4 insertions, 12 deletions
diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb index c00d9014b1d..93ceaa0ebb1 100644 --- a/features/steps/project/fork.rb +++ b/features/steps/project/fork.rb @@ -6,31 +6,23 @@ class ForkProject < Spinach::FeatureSteps step 'I click link "Fork"' do page.should have_content "Shop" page.should have_content "Fork" - Gitlab::Shell.any_instance.stub(:fork_repository).and_return(true) click_link "Fork" end step 'I am a member of project "Shop"' do - @project = Project.find_by(name: "Shop") - @project ||= create(:project, name: "Shop", group: create(:group)) + @project = create(:project, name: "Shop") @project.team << [@user, :reporter] end step 'I should see the forked project page' do page.should have_content "Project was successfully forked." - current_path.should include current_user.namespace.path - @forked_project = Project.find_by(namespace_id: current_user.namespace.path) end step 'I already have a project named "Shop" in my namespace' do - current_user.namespace ||= create(:namespace) - current_user.namespace.should_not be_nil - current_user.namespace.path.should_not be_nil @my_project = create(:project, name: "Shop", namespace: current_user.namespace) end step 'I should see a "Name has already been taken" warning' do page.should have_content "Name has already been taken" end - end diff --git a/spec/support/test_env.rb b/spec/support/test_env.rb index f46405f238b..9e8339ff71a 100644 --- a/spec/support/test_env.rb +++ b/spec/support/test_env.rb @@ -13,14 +13,14 @@ module TestEnv # Disable mailer for spinach tests disable_mailer if opts[:mailer] == false - # Setup GitLab shell for test instance - setup_gitlab_shell - # Clean /tmp/tests tmp_test_path = Rails.root.join('tmp', 'tests') FileUtils.rm_r(tmp_test_path) FileUtils.mkdir(tmp_test_path) + # Setup GitLab shell for test instance + setup_gitlab_shell + # Create repository for FactoryGirl.create(:project) setup_factory_repo end |