branston 0.3.6 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/branston/app/controllers/scenarios_controller.rb +6 -5
- data/lib/branston/app/controllers/stories_controller.rb +101 -89
- data/lib/branston/app/models/story.rb +30 -1
- data/lib/branston/app/models/user.rb +4 -0
- data/lib/branston/app/views/iterations/index.html.erb +1 -1
- data/lib/branston/app/views/layouts/_header.html.erb +1 -2
- data/lib/branston/app/views/scenarios/_scenario.html.erb +6 -3
- data/lib/branston/app/views/scenarios/_scenarios.html.erb +4 -2
- data/lib/branston/app/views/stories/_form.html.erb +15 -4
- data/lib/branston/app/views/stories/_story.html.erb +26 -6
- data/lib/branston/app/views/stories/edit.html.erb +3 -3
- data/lib/branston/app/views/stories/index.html.erb +22 -3
- data/lib/branston/app/views/stories/new.html.erb +2 -2
- data/lib/branston/app/views/stories/show.html.erb +3 -3
- data/lib/branston/config/routes.rb +7 -4
- data/lib/branston/coverage/app-controllers-application_controller_rb.html +1 -1
- data/lib/branston/coverage/app-controllers-iterations_controller_rb.html +1 -1
- data/lib/branston/coverage/app-controllers-outcomes_controller_rb.html +1 -1
- data/lib/branston/coverage/app-controllers-preconditions_controller_rb.html +1 -1
- data/lib/branston/coverage/app-controllers-releases_controller_rb.html +1 -1
- data/lib/branston/coverage/app-controllers-scenarios_controller_rb.html +18 -12
- data/lib/branston/coverage/app-controllers-sessions_controller_rb.html +1 -1
- data/lib/branston/coverage/app-controllers-stories_controller_rb.html +193 -121
- data/lib/branston/coverage/app-controllers-user_roles_controller_rb.html +1 -1
- data/lib/branston/coverage/app-controllers-users_controller_rb.html +1 -1
- data/lib/branston/coverage/app-helpers-application_helper_rb.html +1 -1
- data/lib/branston/coverage/app-helpers-iterations_helper_rb.html +1 -1
- data/lib/branston/coverage/app-helpers-outcomes_helper_rb.html +1 -1
- data/lib/branston/coverage/app-helpers-preconditions_helper_rb.html +1 -1
- data/lib/branston/coverage/app-helpers-releases_helper_rb.html +1 -1
- data/lib/branston/coverage/app-helpers-sessions_helper_rb.html +1 -1
- data/lib/branston/coverage/app-helpers-stories_helper_rb.html +1 -1
- data/lib/branston/coverage/app-helpers-user_roles_helper_rb.html +1 -1
- data/lib/branston/coverage/app-models-iteration_rb.html +1 -1
- data/lib/branston/coverage/app-models-outcome_rb.html +1 -1
- data/lib/branston/coverage/app-models-participation_rb.html +1 -1
- data/lib/branston/coverage/app-models-precondition_rb.html +1 -1
- data/lib/branston/coverage/app-models-release_rb.html +1 -1
- data/lib/branston/coverage/app-models-scenario_rb.html +1 -1
- data/lib/branston/coverage/app-models-story_rb.html +192 -18
- data/lib/branston/coverage/app-models-user_rb.html +33 -9
- data/lib/branston/coverage/app-models-user_role_rb.html +1 -1
- data/lib/branston/coverage/index.html +13 -13
- data/lib/branston/coverage/lib-client_rb.html +1 -1
- data/lib/branston/coverage/lib-faker_extras_rb.html +1 -1
- data/lib/branston/coverage/lib-story_generator_rb.html +1 -1
- data/lib/branston/db/development.sqlite3 +0 -0
- data/lib/branston/db/migrate/20091223100903_add_status_to_story.rb +11 -0
- data/lib/branston/db/pristine.sqlite3 +0 -0
- data/lib/branston/db/schema.rb +5 -3
- data/lib/branston/db/test.sqlite3 +0 -0
- data/lib/branston/lib/branston.rb +4 -2
- data/lib/branston/log/development.log +4970 -0
- data/lib/branston/log/test.log +88225 -0
- data/lib/branston/test/blueprints.rb +10 -7
- data/lib/branston/test/functional/scenarios_controller_test.rb +22 -15
- data/lib/branston/test/functional/stories_controller_test.rb +51 -30
- data/lib/branston/test/unit/story_test.rb +47 -7
- data/lib/branston/test/unit/user_test.rb +4 -0
- data/lib/branston/tmp/performance/BrowsingTest#test_homepage_process_time_flat.txt +3 -2
- data/lib/branston/tmp/performance/BrowsingTest#test_homepage_process_time_graph.html +2041 -1307
- data/lib/branston/tmp/performance/BrowsingTest#test_homepage_process_time_tree.txt +7922 -7922
- data/lib/branston/vendor/plugins/state_machine/CHANGELOG.rdoc +298 -0
- data/lib/branston/vendor/plugins/state_machine/LICENSE +20 -0
- data/lib/branston/vendor/plugins/state_machine/README.rdoc +466 -0
- data/lib/branston/vendor/plugins/state_machine/Rakefile +98 -0
- data/lib/branston/vendor/plugins/state_machine/examples/AutoShop_state.png +0 -0
- data/lib/branston/vendor/plugins/state_machine/examples/Car_state.png +0 -0
- data/lib/branston/vendor/plugins/state_machine/examples/TrafficLight_state.png +0 -0
- data/lib/branston/vendor/plugins/state_machine/examples/Vehicle_state.png +0 -0
- data/lib/branston/vendor/plugins/state_machine/examples/auto_shop.rb +11 -0
- data/lib/branston/vendor/plugins/state_machine/examples/car.rb +19 -0
- data/lib/branston/vendor/plugins/state_machine/examples/merb-rest/controller.rb +51 -0
- data/lib/branston/vendor/plugins/state_machine/examples/merb-rest/model.rb +28 -0
- data/lib/branston/vendor/plugins/state_machine/examples/merb-rest/view_edit.html.erb +24 -0
- data/lib/branston/vendor/plugins/state_machine/examples/merb-rest/view_index.html.erb +23 -0
- data/lib/branston/vendor/plugins/state_machine/examples/merb-rest/view_new.html.erb +13 -0
- data/lib/branston/vendor/plugins/state_machine/examples/merb-rest/view_show.html.erb +17 -0
- data/lib/branston/vendor/plugins/state_machine/examples/rails-rest/controller.rb +43 -0
- data/lib/branston/vendor/plugins/state_machine/examples/rails-rest/migration.rb +11 -0
- data/lib/branston/vendor/plugins/state_machine/examples/rails-rest/model.rb +23 -0
- data/lib/branston/vendor/plugins/state_machine/examples/rails-rest/view_edit.html.erb +25 -0
- data/lib/branston/vendor/plugins/state_machine/examples/rails-rest/view_index.html.erb +23 -0
- data/lib/branston/vendor/plugins/state_machine/examples/rails-rest/view_new.html.erb +14 -0
- data/lib/branston/vendor/plugins/state_machine/examples/rails-rest/view_show.html.erb +17 -0
- data/lib/branston/vendor/plugins/state_machine/examples/traffic_light.rb +7 -0
- data/lib/branston/vendor/plugins/state_machine/examples/vehicle.rb +31 -0
- data/lib/branston/vendor/plugins/state_machine/init.rb +1 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/assertions.rb +36 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/callback.rb +189 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/condition_proxy.rb +94 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/eval_helpers.rb +67 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/event.rb +252 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/event_collection.rb +122 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/extensions.rb +149 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/guard.rb +230 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/integrations/active_record/locale.rb +11 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/integrations/active_record/observer.rb +41 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/integrations/active_record.rb +492 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/integrations/data_mapper/observer.rb +139 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/integrations/data_mapper.rb +351 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/integrations/sequel.rb +322 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/integrations.rb +68 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/machine.rb +1467 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/machine_collection.rb +155 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/matcher.rb +123 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/matcher_helpers.rb +54 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/node_collection.rb +152 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/state.rb +249 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/state_collection.rb +112 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine/transition.rb +394 -0
- data/lib/branston/vendor/plugins/state_machine/lib/state_machine.rb +388 -0
- data/lib/branston/vendor/plugins/state_machine/state_machine.gemspec +30 -0
- data/lib/branston/vendor/plugins/state_machine/tasks/state_machine.rake +1 -0
- data/lib/branston/vendor/plugins/state_machine/tasks/state_machine.rb +30 -0
- data/lib/branston/vendor/plugins/state_machine/test/classes/switch.rb +11 -0
- data/lib/branston/vendor/plugins/state_machine/test/functional/state_machine_test.rb +941 -0
- data/lib/branston/vendor/plugins/state_machine/test/test_helper.rb +4 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/assertions_test.rb +40 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/callback_test.rb +455 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/condition_proxy_test.rb +328 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/eval_helpers_test.rb +120 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/event_collection_test.rb +326 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/event_test.rb +743 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/guard_test.rb +908 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/integrations/active_record_test.rb +1367 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/integrations/data_mapper_test.rb +962 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/integrations/sequel_test.rb +859 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/integrations_test.rb +42 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/invalid_event_test.rb +7 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/invalid_transition_test.rb +7 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/machine_collection_test.rb +938 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/machine_test.rb +2004 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/matcher_helpers_test.rb +37 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/matcher_test.rb +155 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/node_collection_test.rb +207 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/state_collection_test.rb +280 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/state_machine_test.rb +31 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/state_test.rb +795 -0
- data/lib/branston/vendor/plugins/state_machine/test/unit/transition_test.rb +1212 -0
- metadata +81 -2
@@ -63,19 +63,22 @@ end
|
|
63
63
|
|
64
64
|
Scenario.blueprint do
|
65
65
|
title
|
66
|
-
story
|
67
66
|
end
|
68
67
|
|
69
68
|
Story.blueprint do
|
70
69
|
title
|
70
|
+
iteration
|
71
71
|
description
|
72
72
|
points { 2 }
|
73
|
+
author { User.make }
|
73
74
|
end
|
74
75
|
|
75
76
|
Story.blueprint(:in_progress) do
|
76
|
-
|
77
|
-
|
78
|
-
|
77
|
+
status { 'in_progress' }
|
78
|
+
end
|
79
|
+
|
80
|
+
Story.blueprint(:completed) do
|
81
|
+
status { 'completed' }
|
79
82
|
end
|
80
83
|
|
81
84
|
Outcome.blueprint do
|
@@ -91,12 +94,12 @@ module Factory
|
|
91
94
|
|
92
95
|
def make_story(story_options = {})
|
93
96
|
story = Story.make(story_options)
|
94
|
-
2.times { story.scenarios << make_scenario }
|
97
|
+
2.times { story.scenarios << make_scenario(story) }
|
95
98
|
return story
|
96
99
|
end
|
97
100
|
|
98
|
-
def make_scenario
|
99
|
-
scenario = Scenario.make
|
101
|
+
def make_scenario(story)
|
102
|
+
scenario = Scenario.make(:story => story)
|
100
103
|
scenario.preconditions.make
|
101
104
|
scenario.preconditions.make(:longer)
|
102
105
|
2.times { scenario.outcomes.make }
|
@@ -5,18 +5,19 @@ class ScenariosControllerTest < ActionController::TestCase
|
|
5
5
|
context "The ScenariosController" do
|
6
6
|
setup do
|
7
7
|
login_as(User.make)
|
8
|
-
@
|
9
|
-
@
|
8
|
+
@story = Factory.make_story
|
9
|
+
@iteration = @story.iteration
|
10
|
+
@scenario = @story.scenarios.first
|
10
11
|
end
|
11
12
|
|
12
13
|
should "get index" do
|
13
|
-
get :index, :story_id => @story.to_param
|
14
|
+
get :index, :story_id => @story.to_param, :iteration_id => @iteration.to_param
|
14
15
|
assert_response :success
|
15
16
|
assert_not_nil assigns(:scenarios)
|
16
17
|
end
|
17
18
|
|
18
19
|
should "get new" do
|
19
|
-
get :new, :story_id => @story.to_param
|
20
|
+
get :new, :story_id => @story.to_param, :iteration_id => @iteration.to_param
|
20
21
|
assert_response :success
|
21
22
|
end
|
22
23
|
|
@@ -24,12 +25,13 @@ class ScenariosControllerTest < ActionController::TestCase
|
|
24
25
|
context "with valid params" do
|
25
26
|
setup do
|
26
27
|
assert_difference('Scenario.count') do
|
27
|
-
post :create, :scenario => { :title => "Foo" }, :story_id => @story.to_param
|
28
|
+
post :create, :scenario => { :title => "Foo" }, :story_id => @story.to_param,
|
29
|
+
:iteration_id => @iteration.to_param
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
31
33
|
should "redirect to show" do
|
32
|
-
assert_redirected_to
|
34
|
+
assert_redirected_to iteration_story_scenario_path(@iteration, assigns(:story), assigns(:scenario))
|
33
35
|
end
|
34
36
|
|
35
37
|
end
|
@@ -37,7 +39,8 @@ class ScenariosControllerTest < ActionController::TestCase
|
|
37
39
|
context "with invalid params" do
|
38
40
|
setup do
|
39
41
|
assert_no_difference('Scenario.count') do
|
40
|
-
post :create, :scenario => { }, :story_id => @story.to_param
|
42
|
+
post :create, :scenario => { }, :story_id => @story.to_param,
|
43
|
+
:iteration_id => @iteration.to_param
|
41
44
|
end
|
42
45
|
end
|
43
46
|
|
@@ -52,20 +55,21 @@ class ScenariosControllerTest < ActionController::TestCase
|
|
52
55
|
end
|
53
56
|
end
|
54
57
|
|
55
|
-
|
56
58
|
context "updating a scenario" do
|
57
59
|
context "with valid params" do
|
58
60
|
setup do
|
59
|
-
put :update, :id => @scenario.to_param, :scenario => { :title => "Bar" },
|
61
|
+
put :update, :id => @scenario.to_param, :scenario => { :title => "Bar" },
|
62
|
+
:story_id => @story.to_param, :iteration_id => @iteration.to_param
|
60
63
|
end
|
61
64
|
should "redirect to show" do
|
62
|
-
assert_redirected_to
|
65
|
+
assert_redirected_to iteration_story_scenario_path(@iteration, assigns(:story), assigns(:scenario))
|
63
66
|
end
|
64
67
|
end
|
65
68
|
|
66
69
|
context "with invalid params" do
|
67
70
|
setup do
|
68
|
-
put :update, :id => @scenario.to_param, :scenario => { :title => "" },
|
71
|
+
put :update, :id => @scenario.to_param, :scenario => { :title => "" },
|
72
|
+
:story_id => @story.to_param, :iteration_id => @iteration.to_param
|
69
73
|
end
|
70
74
|
|
71
75
|
should "redisplay" do
|
@@ -80,20 +84,23 @@ class ScenariosControllerTest < ActionController::TestCase
|
|
80
84
|
|
81
85
|
|
82
86
|
should "show scenario" do
|
83
|
-
get :show, :id => @scenario.to_param, :story_id => @story.to_param
|
87
|
+
get :show, :id => @scenario.to_param, :story_id => @story.to_param,
|
88
|
+
:iteration_id => @iteration.to_param
|
84
89
|
assert_response :success
|
85
90
|
end
|
86
91
|
|
87
92
|
should "get edit" do
|
88
|
-
get :edit, :id => @scenario.to_param, :story_id => @story.to_param
|
93
|
+
get :edit, :id => @scenario.to_param, :story_id => @story.to_param,
|
94
|
+
:iteration_id => @iteration.to_param
|
89
95
|
assert_response :success
|
90
96
|
end
|
91
97
|
|
92
98
|
should "destroy scenario" do
|
93
99
|
assert_difference('Scenario.count', -1) do
|
94
|
-
delete :destroy, :id => @scenario.to_param, :story_id => @story.to_param
|
100
|
+
delete :destroy, :id => @scenario.to_param, :story_id => @story.to_param,
|
101
|
+
:iteration_id => @iteration.to_param
|
95
102
|
end
|
96
|
-
assert_redirected_to
|
103
|
+
assert_redirected_to iteration_story_scenarios_path(@iteration, @story.to_param)
|
97
104
|
end
|
98
105
|
end
|
99
106
|
end
|
@@ -4,51 +4,65 @@ class StoriesControllerTest < ActionController::TestCase
|
|
4
4
|
|
5
5
|
context "The StoriesController" do
|
6
6
|
setup do
|
7
|
-
@
|
7
|
+
@iteration = Iteration.make
|
8
|
+
@story = Factory.make_story(:iteration => @iteration)
|
9
|
+
@in_progress = Factory.make_story(:iteration => @iteration, :status => "in_progress")
|
10
|
+
@completed = Factory.make_story(:iteration => @iteration, :status => "completed")
|
11
|
+
|
12
|
+
@some_other_iteration = Iteration.make
|
13
|
+
@later = Story.make(:iteration => @some_other_iteration)
|
14
|
+
end
|
15
|
+
|
16
|
+
teardown do
|
17
|
+
feature_file = FEATURE_PATH + @story.feature_filename
|
18
|
+
FileUtils.rm feature_file if File.exists? feature_file
|
19
|
+
step_file = FEATURE_PATH + @story.step_filename
|
20
|
+
FileUtils.rm step_file if File.exists? step_file
|
8
21
|
end
|
9
22
|
|
10
23
|
context "with a logged-in user" do
|
11
|
-
setup do
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
teardown do
|
16
|
-
feature_file = FEATURE_PATH + @story.feature_filename
|
17
|
-
FileUtils.rm feature_file if File.exists? feature_file
|
18
|
-
step_file = FEATURE_PATH + @story.step_filename
|
19
|
-
FileUtils.rm step_file if File.exists? step_file
|
24
|
+
setup do
|
25
|
+
@user = User.make
|
26
|
+
login_as(@user)
|
20
27
|
end
|
21
28
|
|
22
|
-
should "show a list of all the stories" do
|
23
|
-
get :index
|
29
|
+
should "show a list of all the stories in the current iteration" do
|
30
|
+
get :index, :iteration_id => @iteration.to_param
|
24
31
|
assert_response :success
|
25
32
|
assert_not_nil assigns(:backlog_stories)
|
33
|
+
assert_not_nil assigns(:completed_stories)
|
34
|
+
assert_not_nil assigns(:current_stories)
|
35
|
+
assert_equal 1, assigns(:backlog_stories).size
|
36
|
+
assert_equal 1, assigns(:completed_stories).size
|
37
|
+
assert_equal 1, assigns(:current_stories).size
|
38
|
+
assert assigns(:backlog_stories).include? @story
|
39
|
+
assert assigns(:current_stories).include? @in_progress
|
40
|
+
assert assigns(:completed_stories).include? @completed
|
26
41
|
end
|
27
42
|
|
28
43
|
should "show a form to edit stories" do
|
29
|
-
get :edit, :id => @story.to_param
|
44
|
+
get :edit, :id => @story.to_param, :iteration_id => @iteration.to_param
|
30
45
|
assert_response :success
|
31
46
|
assert assigns(:iterations)
|
32
47
|
end
|
33
48
|
|
34
49
|
should "show a form to add stories" do
|
35
|
-
get :new
|
50
|
+
get :new, :iteration_id => @iteration.to_param
|
36
51
|
assert_response :success
|
37
52
|
assert assigns(:iterations)
|
38
53
|
end
|
39
54
|
|
40
|
-
|
41
|
-
|
42
55
|
should "delete a story" do
|
43
56
|
assert_difference('Story.count', -1) do
|
44
|
-
delete :destroy, :id => @story.to_param
|
57
|
+
delete :destroy, :id => @story.to_param, :iteration_id => @iteration.to_param
|
45
58
|
end
|
46
59
|
|
47
|
-
assert_redirected_to
|
60
|
+
assert_redirected_to iteration_stories_path(@iteration)
|
48
61
|
end
|
49
62
|
|
50
63
|
should "generate the cucumber feature file for a story" do
|
51
|
-
get :generate_feature, :id => @story.to_param, :path => 'test/features/'
|
64
|
+
get :generate_feature, :id => @story.to_param, :path => 'test/features/',
|
65
|
+
:iteration_id => @iteration.to_param
|
52
66
|
assert_response :success
|
53
67
|
assert File.exists? FEATURE_PATH + @story.feature_filename
|
54
68
|
assert File.exists? FEATURE_PATH + @story.step_filename
|
@@ -59,22 +73,27 @@ class StoriesControllerTest < ActionController::TestCase
|
|
59
73
|
context "with valid params" do
|
60
74
|
setup do
|
61
75
|
assert_difference("Story.count") do
|
62
|
-
post :create, :story => Story.plan
|
76
|
+
post :create, :story => Story.plan, :iteration_id => @iteration.to_param
|
63
77
|
end
|
64
78
|
end
|
65
79
|
|
66
80
|
should "redirect to show" do
|
67
|
-
assert_redirected_to
|
81
|
+
assert_redirected_to iteration_stories_path(@iteration)
|
82
|
+
end
|
83
|
+
|
84
|
+
should "be associated with an iteration" do
|
85
|
+
assert assigns(:story).iteration
|
68
86
|
end
|
69
87
|
|
70
|
-
should "
|
71
|
-
|
88
|
+
should "remember who authored it" do
|
89
|
+
assert_equal @user, assigns(:story).author
|
72
90
|
end
|
73
91
|
|
74
92
|
context "including an iteration id" do
|
75
93
|
setup do
|
76
94
|
assert_difference("Story.count") do
|
77
|
-
post :create, :story => Story.plan(:in_progress)
|
95
|
+
post :create, :story => Story.plan(:in_progress),
|
96
|
+
:iteration_id => @iteration.to_param
|
78
97
|
end
|
79
98
|
end
|
80
99
|
|
@@ -87,7 +106,7 @@ class StoriesControllerTest < ActionController::TestCase
|
|
87
106
|
context "with invalid params" do
|
88
107
|
setup do
|
89
108
|
assert_no_difference("Story.count") do
|
90
|
-
post :create, :story => {}
|
109
|
+
post :create, :story => {}, :iteration_id => @iteration.to_param
|
91
110
|
end
|
92
111
|
end
|
93
112
|
|
@@ -102,19 +121,21 @@ class StoriesControllerTest < ActionController::TestCase
|
|
102
121
|
context "with valid parameters" do
|
103
122
|
setup do
|
104
123
|
assert_no_difference("Story.count") do
|
105
|
-
put :update,{ :id => @story.to_param, :story => {:description => "bar"}
|
124
|
+
put :update,{ :id => @story.to_param, :story => {:description => "bar"},
|
125
|
+
:iteration_id => @iteration.to_param }
|
106
126
|
end
|
107
127
|
end
|
108
128
|
|
109
129
|
should "redirect to show" do
|
110
|
-
assert_redirected_to
|
130
|
+
assert_redirected_to iteration_story_path(@iteration, @story)
|
111
131
|
end
|
112
132
|
|
113
133
|
end
|
114
134
|
|
115
135
|
context "with invalid parameters" do
|
116
136
|
setup do
|
117
|
-
put :update, :id => @story.to_param, :story => {:description => ""}
|
137
|
+
put :update, :id => @story.to_param, :story => {:description => ""},
|
138
|
+
:iteration_id => @iteration.to_param
|
118
139
|
end
|
119
140
|
|
120
141
|
should "redisplay the edit template" do
|
@@ -129,12 +150,12 @@ class StoriesControllerTest < ActionController::TestCase
|
|
129
150
|
context "Without logging in, the StoriesController" do
|
130
151
|
|
131
152
|
should "show details about a story" do
|
132
|
-
get :show, :id => @story.to_param
|
153
|
+
get :show, :id => @story.to_param, :iteration_id => @iteration.to_param
|
133
154
|
assert_response :success
|
134
155
|
end
|
135
156
|
|
136
157
|
should "fail gracefully if the slug is not found" do
|
137
|
-
get :show, :id => 'none-such-story'
|
158
|
+
get :show, :id => 'none-such-story', :iteration_id => @iteration.to_param
|
138
159
|
assert_response 404
|
139
160
|
end
|
140
161
|
end
|
@@ -22,6 +22,34 @@ class StoryTest < ActiveSupport::TestCase
|
|
22
22
|
FileUtils.rm @step_file if @step_file != nil and File.exists? @step_file
|
23
23
|
end
|
24
24
|
|
25
|
+
should "start life with status new" do
|
26
|
+
assert @story.new?
|
27
|
+
end
|
28
|
+
|
29
|
+
context "transisted to in_progress" do
|
30
|
+
setup do
|
31
|
+
assert @story.assign
|
32
|
+
end
|
33
|
+
|
34
|
+
should "transist to in_progress" do
|
35
|
+
assert @story.in_progress?
|
36
|
+
end
|
37
|
+
|
38
|
+
context "then transisted to completed" do
|
39
|
+
setup do
|
40
|
+
assert @story.finish
|
41
|
+
end
|
42
|
+
|
43
|
+
should "transist to completed" do
|
44
|
+
assert @story.completed?
|
45
|
+
end
|
46
|
+
|
47
|
+
should "set the completed date when in the completed state" do
|
48
|
+
assert_equal Date.today, @story.completed_date
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
25
53
|
should "set a slug when its saved" do
|
26
54
|
assert_not_nil @story.slug
|
27
55
|
assert_equal 'product-search', @story.slug
|
@@ -112,8 +140,6 @@ class StoryTest < ActiveSupport::TestCase
|
|
112
140
|
assert_equal "end\n", f.gets
|
113
141
|
assert_equal "\n", f.gets
|
114
142
|
|
115
|
-
|
116
|
-
|
117
143
|
outcome = @story.scenarios.last.outcomes[0]
|
118
144
|
assert_equal "Then #{regexp(outcome.to_s)} do |a|\n", f.gets
|
119
145
|
assert_equal "\t#TODO: Define these steps\n", f.gets
|
@@ -135,21 +161,35 @@ class StoryTest < ActiveSupport::TestCase
|
|
135
161
|
end
|
136
162
|
|
137
163
|
end
|
138
|
-
|
164
|
+
|
139
165
|
context "The Story class" do
|
140
166
|
|
141
167
|
should "have an in_progress named_scope" do
|
142
168
|
assert Story.respond_to?("in_progress")
|
143
169
|
end
|
144
170
|
|
145
|
-
|
171
|
+
context "named_scope in_progress" do
|
146
172
|
setup do
|
147
|
-
Story.make
|
148
|
-
Story.make(:in_progress)
|
173
|
+
@story = Story.make
|
174
|
+
@in_progress = Story.make(:in_progress)
|
175
|
+
@completed = Story.make(:completed)
|
176
|
+
@iteration = @story.iteration
|
149
177
|
end
|
150
178
|
|
151
179
|
should "only find stories that are assigned to an iteration" do
|
152
|
-
assert_equal
|
180
|
+
assert_equal @story, Story.for_iteration(@iteration.id).first
|
181
|
+
end
|
182
|
+
|
183
|
+
should "only find stories that are unassigned" do
|
184
|
+
assert_equal @story, Story.unassigned.first
|
185
|
+
end
|
186
|
+
|
187
|
+
should "only find stories that are in progress" do
|
188
|
+
assert_equal @in_progress, Story.in_progress.first
|
189
|
+
end
|
190
|
+
|
191
|
+
should "only find stories that are completed" do
|
192
|
+
assert_equal @completed, Story.completed.first
|
153
193
|
end
|
154
194
|
end
|
155
195
|
|
@@ -57,6 +57,10 @@ class UserTest < ActiveSupport::TestCase
|
|
57
57
|
setup do
|
58
58
|
@quentin = User.make(:quentin)
|
59
59
|
end
|
60
|
+
|
61
|
+
should "print its login when to_s is called" do
|
62
|
+
assert_equal "quentin", @quentin.to_s
|
63
|
+
end
|
60
64
|
|
61
65
|
should "reset_password" do
|
62
66
|
@quentin.update_attributes(:password => 'new password', :password_confirmation => 'new password')
|
@@ -1,7 +1,8 @@
|
|
1
|
-
Thread ID:
|
1
|
+
Thread ID: 70273854970300
|
2
2
|
Total: 0.020000
|
3
3
|
|
4
4
|
%self total self wait child calls name
|
5
|
-
50.00 0.01 0.01 0.00 0.00
|
5
|
+
50.00 0.01 0.01 0.00 0.00 1 <Module::Base64>#encode64
|
6
|
+
50.00 0.01 0.01 0.00 0.00 11 Mime::Type::AcceptItem#<=>
|
6
7
|
|
7
8
|
|