Commit 61f70334 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Cleanup test dir before install gitlab-shell. Fix fork test scenario

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent b238b154
......@@ -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
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment