Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandx <dmitriy.zaporozhets@gmail.com>2012-06-16 13:50:14 +0400
committerrandx <dmitriy.zaporozhets@gmail.com>2012-06-16 13:50:14 +0400
commit781fd1a80c6b65fa8c0cd71001be681e955c4edb (patch)
treee766cc83fd9d516930b45afd90a6b1ff43c7ae3d /features/step_definitions
parent85b86e6476f5a9810f9c13b3a62c457439305f13 (diff)
Cucumber -> Dashboard features
Diffstat (limited to 'features/step_definitions')
-rw-r--r--features/step_definitions/dashboard_steps.rb67
1 files changed, 67 insertions, 0 deletions
diff --git a/features/step_definitions/dashboard_steps.rb b/features/step_definitions/dashboard_steps.rb
new file mode 100644
index 00000000000..a7353facca5
--- /dev/null
+++ b/features/step_definitions/dashboard_steps.rb
@@ -0,0 +1,67 @@
+Given /^I visit dashboard page$/ do
+ visit dashboard_path
+end
+
+Then /^I should see "(.*?)" link$/ do |arg1|
+ page.should have_link(arg1)
+end
+
+Then /^I should see "(.*?)" project link$/ do |arg1|
+ page.should have_link(arg1)
+end
+
+Then /^I should see project "(.*?)" activity feed$/ do |arg1|
+ project = Project.find_by_name(arg1)
+ page.should have_content "#{@user.name} pushed new branch new_design at #{project.name}"
+end
+
+Given /^project "(.*?)" has push event$/ do |arg1|
+ @project = Project.find_by_name(arg1)
+
+ data = {
+ :before => "0000000000000000000000000000000000000000",
+ :after => "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",
+ :ref => "refs/heads/new_design",
+ :user_id => @user.id,
+ :user_name => @user.name,
+ :repository => {
+ :name => @project.name,
+ :url => "localhost/rubinius",
+ :description => "",
+ :homepage => "localhost/rubinius",
+ :private => true
+ }
+ }
+
+ @event = Event.create(
+ :project => @project,
+ :action => Event::Pushed,
+ :data => data,
+ :author_id => @user.id
+ )
+end
+
+Then /^I should see last push widget$/ do
+ page.should have_content "Your last push was to branch new_design"
+ page.should have_link "Create Merge Request"
+end
+
+Then /^I click "(.*?)" link$/ do |arg1|
+ click_link "Create Merge Request"
+end
+
+Then /^I see prefilled new Merge Request page$/ do
+ current_path.should == new_project_merge_request_path(@project)
+ find("#merge_request_source_branch").value.should == "new_design"
+ find("#merge_request_target_branch").value.should == "master"
+ find("#merge_request_title").value.should == "New Design"
+end
+
+Given /^I visit dashboard search page$/ do
+ visit search_path
+end
+
+Given /^I search for "(.*?)"$/ do |arg1|
+ fill_in "dashboard_search", :with => arg1
+ click_button "Search"
+end