@ -42,13 +42,13 @@ Given /^I am viewing the master backlog$/ do
end
end
Given / ^I am viewing the burndown for (.+)$ / do | sprint_name |
Given / ^I am viewing the burndown for (.+)$ / do | sprint_name |
@sprint = Sprint . find ( :first , :conditions = > " name=' #{ sprint_name } ' " )
@sprint = Sprint . find ( :first , :conditions = > [ " name=? " , sprint_name ] )
visit url_for ( :controller = > :rb_burndown_charts , :action = > :show , :id = > @sprint . id )
visit url_for ( :controller = > :rb_burndown_charts , :action = > :show , :id = > @sprint . id )
page . driver . response . status . should == 200
page . driver . response . status . should == 200
end
end
Given / ^I am viewing the taskboard for (.+)$ / do | sprint_name |
Given / ^I am viewing the taskboard for (.+)$ / do | sprint_name |
@sprint = Sprint . find ( :first , :conditions = > " name=' #{ sprint_name } ' " )
@sprint = Sprint . find ( :first , :conditions = > [ " name=? " , sprint_name ] )
visit url_for ( :controller = > :rb_taskboards , :action = > :show , :id = > @sprint . id )
visit url_for ( :controller = > :rb_taskboards , :action = > :show , :id = > @sprint . id )
page . driver . response . status . should == 200
page . driver . response . status . should == 200
end
end
@ -56,10 +56,10 @@ end
Given / ^I set the (.+) of the story to (.+)$ / do | attribute , value |
Given / ^I set the (.+) of the story to (.+)$ / do | attribute , value |
if attribute == " tracker "
if attribute == " tracker "
attribute = " tracker_id "
attribute = " tracker_id "
value = Tracker . find ( :first , :conditions = > " name=' #{ value } ' " ) . id
value = Tracker . find ( :first , :conditions = > [ " name=? " , value ] ) . id
elsif attribute == " status "
elsif attribute == " status "
attribute = " status_id "
attribute = " status_id "
value = IssueStatus . find ( :first , :conditions = > " name=' #{ value } ' " ) . id
value = IssueStatus . find ( :first , :conditions = > [ " name=? " , value ] ) . id
end
end
@story_params [ attribute ] = value
@story_params [ attribute ] = value
end
end
@ -74,7 +74,7 @@ Given /^I want to create a story$/ do
end
end
Given / ^I want to create a task for (.+)$ / do | story_subject |
Given / ^I want to create a task for (.+)$ / do | story_subject |
story = Story . find ( :first , :conditions = > " subject=' #{ story_subject } ' " )
story = Story . find ( :first , :conditions = > [ " subject=? " , story_subject ] )
@task_params = initialize_task_params ( story . id )
@task_params = initialize_task_params ( story . id )
end
end
@ -96,7 +96,7 @@ Given /^I want to edit the impediment named (.+)$/ do |impediment_subject|
end
end
Given / ^I want to edit the sprint named (.+)$ / do | name |
Given / ^I want to edit the sprint named (.+)$ / do | name |
sprint = Sprint . find ( :first , :conditions = > " name=' #{ name } ' " )
sprint = Sprint . find ( :first , :conditions = > [ " name=? " , name ] )
sprint . should_not be_nil
sprint . should_not be_nil
@sprint_params = HashWithIndifferentAccess . new ( sprint . attributes )
@sprint_params = HashWithIndifferentAccess . new ( sprint . attributes )
end
end
@ -117,7 +117,7 @@ Given /^I want to set the (.+) of the impediment to (.+)$/ do |attribute, value|
end
end
Given / ^I want to edit the story with subject (.+)$ / do | subject |
Given / ^I want to edit the story with subject (.+)$ / do | subject |
@story = Story . find ( :first , :conditions = > " subject=' #{ subject } ' " )
@story = Story . find ( :first , :conditions = > [ " subject=? " , subject ] )
@story . should_not be_nil
@story . should_not be_nil
@story_params = HashWithIndifferentAccess . new ( @story . attributes )
@story_params = HashWithIndifferentAccess . new ( @story . attributes )
end
end
@ -174,7 +174,7 @@ Given /^the project has the following stories in the following sprints:$/ do |ta
params = initialize_story_params
params = initialize_story_params
params [ 'subject' ] = story [ 'subject' ]
params [ 'subject' ] = story [ 'subject' ]
params [ 'prev_id' ] = prev_id
params [ 'prev_id' ] = prev_id
params [ 'fixed_version_id' ] = ( Sprint . find ( :first , :conditions = > " name=' #{ story [ 'sprint' ] } ' " ) || Sprint . new ) . id
params [ 'fixed_version_id' ] = ( Sprint . find ( :first , :conditions = > [ " name=? " , story [ 'sprint' ] ] ) || Sprint . new ) . id
# NOTE: We're bypassing the controller here because we're just
# NOTE: We're bypassing the controller here because we're just
# setting up the database for the actual tests. The actual tests,
# setting up the database for the actual tests. The actual tests,