forge-cli 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +6 -14
  2. data/bin/cucumber +16 -0
  3. data/bin/erubis +16 -0
  4. data/bin/htmldiff +16 -0
  5. data/bin/ldiff +16 -0
  6. data/bin/rackup +16 -0
  7. data/bin/rake +16 -0
  8. data/bin/rdoc +16 -0
  9. data/bin/ri +16 -0
  10. data/bin/sprockets +16 -0
  11. data/bin/thor +16 -0
  12. data/bin/tilt +16 -0
  13. data/bin/tt +16 -0
  14. data/lib/forge-cli/modules/base/manifest.yml +18 -0
  15. data/lib/forge-cli/modules/base/routes.rb +1 -2
  16. data/lib/forge-cli/modules/events/routes.rb +6 -1
  17. data/lib/forge-cli/version.rb +1 -1
  18. data/lib/forge/Gemfile +2 -0
  19. data/lib/forge/app/controllers/events_controller.rb +11 -0
  20. data/lib/forge/app/controllers/pages_controller.rb +1 -1
  21. data/lib/forge/app/controllers/products_controller.rb +1 -1
  22. data/lib/forge/app/views/forge/dispatches/_form.html.haml +0 -13
  23. data/lib/forge/app/views/forge/events/_form.html.haml +14 -10
  24. data/lib/forge/app/views/forge/posts/_form.html.haml +2 -2
  25. data/lib/forge/app/views/forge/products/_form.html.haml +10 -4
  26. data/lib/forge/config/routes.rb +8 -3
  27. data/lib/forge/features/authentication.feature +8 -0
  28. data/lib/forge/features/step_definitions/web_steps.rb +24 -0
  29. data/lib/forge/features/support/env.rb +60 -0
  30. data/lib/forge/features/support/paths.rb +20 -0
  31. data/lib/forge/lib/assets/javascripts/forge/features/asset_uploads.js.erb +1 -1
  32. data/lib/forge/lib/generators/forge/scaffold/templates/controller_spec.rb +48 -48
  33. data/lib/forge/lib/generators/forge/scaffold_small/templates/controller_spec.rb +42 -42
  34. data/lib/forge/spec/controllers/forge/banners_controller_spec.rb +47 -47
  35. data/lib/forge/spec/controllers/forge/dispatches_controller_spec.rb +45 -45
  36. data/lib/forge/spec/controllers/forge/events_controller_spec.rb +45 -45
  37. data/lib/forge/spec/controllers/forge/galleries_controller_spec.rb +44 -44
  38. data/lib/forge/spec/controllers/forge/orders_controller_spec.rb +45 -45
  39. data/lib/forge/spec/controllers/forge/pages_controller_spec.rb +46 -46
  40. data/lib/forge/spec/controllers/forge/post_categories_controller_spec.rb +41 -41
  41. data/lib/forge/spec/controllers/forge/posts_controller_spec.rb +45 -45
  42. data/lib/forge/spec/controllers/forge/product_categories_controller_spec.rb +42 -42
  43. data/lib/forge/spec/controllers/forge/products_controller_spec.rb +47 -47
  44. data/lib/forge/spec/controllers/forge/sales_controller_spec.rb +45 -45
  45. data/lib/forge/spec/controllers/forge/subscriber_groups_controller_spec.rb +45 -45
  46. data/lib/forge/spec/controllers/forge/subscribers_controller_spec.rb +40 -40
  47. data/lib/forge/spec/controllers/forge/tax_rates_controller_spec.rb +41 -41
  48. data/lib/forge/spec/controllers/forge/users_controller_spec.rb +58 -58
  49. data/lib/forge/spec/controllers/forge/videos_controller_spec.rb +9 -9
  50. data/lib/forge/spec/models/reorderable_spec.rb +5 -5
  51. metadata +31 -21
  52. data/lib/forge/config/database.yml +0 -24
  53. data/lib/forge/config/deploy.rb +0 -53
  54. data/lib/forge/config/dispatch_daemon.yml +0 -23
  55. data/lib/forge/config/s3.yml +0 -19
  56. data/lib/forge/log/development.log +0 -2
  57. data/lib/forge/script/dispatch_daemon_fetcher +0 -28
@@ -4,24 +4,24 @@ describe Forge::BannersController do
4
4
  describe "As an admin" do
5
5
  fixtures :users, :roles
6
6
  before do
7
- controller.stub!(:current_user).and_return(users(:admin))
7
+ controller.stub(:current_user).and_return(users(:admin))
8
8
  end
9
-
9
+
10
10
  # NEW
11
11
  describe "GET banners/new" do
12
12
  before do
13
13
  get :new
14
14
  end
15
-
15
+
16
16
  it "should assign @banner" do
17
17
  assigns[:banner].should_not be_nil
18
18
  end
19
-
19
+
20
20
  it "should render the new template" do
21
21
  response.should render_template('new')
22
22
  end
23
23
  end
24
-
24
+
25
25
  # EDIT
26
26
  describe "GET banners/:id/edit" do
27
27
  before do
@@ -29,145 +29,145 @@ describe Forge::BannersController do
29
29
  Banner.should_receive(:find).with("1").and_return(@banner)
30
30
  get :edit, :id => 1
31
31
  end
32
-
32
+
33
33
  it "should assign @banner" do
34
34
  assigns[:banner].should == @banner
35
35
  end
36
-
36
+
37
37
  it "should render the edit template" do
38
38
  response.should render_template('edit')
39
39
  end
40
40
  end
41
-
41
+
42
42
 
43
43
  # CREATE
44
44
  describe "POST banners/" do
45
45
  def do_create
46
46
  post :create, :banner => {}
47
47
  end
48
-
49
- describe "with valid attributes" do
48
+
49
+ describe "with valid attributes" do
50
50
  before do
51
51
  @banner = mock_model(Banner, :save => true)
52
- Banner.stub!(:new).and_return(@banner)
52
+ Banner.stub(:new).and_return(@banner)
53
53
  end
54
-
54
+
55
55
  it "should assign @banner" do
56
56
  do_create
57
57
  assigns[:banner].should == @banner
58
58
  end
59
-
59
+
60
60
  it "should set the flash notice" do
61
61
  do_create
62
62
  flash[:notice].should_not be_nil
63
63
  end
64
-
64
+
65
65
  it "should redirect to the index" do
66
66
  do_create
67
67
  response.should redirect_to(forge_banners_path)
68
68
  end
69
-
69
+
70
70
  it "should be valid" do
71
71
  @banner.should_receive(:save).and_return(:true)
72
72
  do_create
73
73
  end
74
74
  end
75
-
75
+
76
76
  describe "with invalid attributes" do
77
77
  before do
78
78
  @banner = mock_model(Banner, :save => false)
79
- Banner.stub!(:new).and_return(@banner)
79
+ Banner.stub(:new).and_return(@banner)
80
80
  end
81
-
81
+
82
82
  it "should assign @banner" do
83
83
  do_create
84
84
  assigns[:banner].should == @banner
85
85
  end
86
-
86
+
87
87
  it "should not set the flash notice" do
88
88
  do_create
89
89
  flash[:notice].should be_nil
90
90
  end
91
-
91
+
92
92
  it "should render the new template" do
93
93
  do_create
94
94
  response.should render_template('new')
95
95
  end
96
-
96
+
97
97
  it "should not save" do
98
98
  @banner.should_receive(:save).and_return(:false)
99
99
  do_create
100
100
  end
101
101
  end
102
102
  end
103
-
103
+
104
104
  # UPDATE
105
105
  describe "PUT banners/:id" do
106
106
  def do_update
107
107
  put :update, :id => "1", :banner => {}
108
- end
109
-
108
+ end
109
+
110
110
  describe "with valid params" do
111
111
  before(:each) do
112
112
  @banner = mock_model(Banner, :update_attributes => true)
113
- Banner.stub!(:find).with("1").and_return(@banner)
113
+ Banner.stub(:find).with("1").and_return(@banner)
114
114
  end
115
-
115
+
116
116
  it "should find banner and return object" do
117
117
  do_update
118
118
  assigns[:banner].should == @banner
119
119
  end
120
-
120
+
121
121
  it "should update the banner object's attributes" do
122
122
  @banner.should_receive(:update_attributes)
123
123
  do_update
124
124
  end
125
-
125
+
126
126
  it "should redirect to the banner index page" do
127
127
  do_update
128
128
  response.should redirect_to(forge_banners_path)
129
129
  end
130
130
  end
131
-
131
+
132
132
  describe "with invalid params" do
133
133
  before(:each) do
134
134
  @banner = mock_model(Banner, :update_attributes => false)
135
- Banner.stub!(:find).with("1").and_return(@banner)
135
+ Banner.stub(:find).with("1").and_return(@banner)
136
136
  end
137
-
137
+
138
138
  it "should find banner and return object" do
139
139
  do_update
140
140
  assigns[:banner].should == @banner
141
141
  end
142
-
142
+
143
143
  it "should update the banner object's attributes" do
144
144
  @banner.should_receive(:update_attributes)
145
145
  do_update
146
146
  end
147
-
147
+
148
148
  it "should render the edit form" do
149
149
  do_update
150
150
  response.should render_template('edit')
151
151
  end
152
-
152
+
153
153
  it "should not have a flash notice" do
154
154
  do_update
155
155
  flash[:notice].should be_blank
156
156
  end
157
157
  end
158
-
158
+
159
159
  end
160
-
160
+
161
161
  # DESTROY
162
162
  describe "DELETE /banners/:id" do
163
163
  it "should delete" do
164
164
  @banner = mock_model(Banner)
165
- Banner.stub!(:find).and_return(@banner)
165
+ Banner.stub(:find).and_return(@banner)
166
166
  @banner.should_receive(:destroy)
167
167
  delete :destroy, :id => 1
168
168
  end
169
169
  end
170
-
170
+
171
171
  # REORDER
172
172
  describe "POST /banners/reorder" do
173
173
  it "should call reorder" do
@@ -175,35 +175,35 @@ describe Forge::BannersController do
175
175
  post :reorder, :banner_list => ["1","2","3"]
176
176
  end
177
177
  end
178
-
178
+
179
179
  end
180
-
181
-
180
+
181
+
182
182
  describe "As someone who's not logged in" do
183
183
  before do
184
- controller.stub!(:current_user).and_return(nil)
184
+ controller.stub(:current_user).and_return(nil)
185
185
  end
186
-
186
+
187
187
  it "should not let you get the new action" do
188
188
  get :new
189
189
  response.should redirect_to('/login')
190
190
  end
191
-
191
+
192
192
  it "should not let you get the edit action" do
193
193
  get :edit, :id => 1
194
194
  response.should redirect_to('/login')
195
195
  end
196
-
196
+
197
197
  it "should not let you get the create action" do
198
198
  post :create
199
199
  response.should redirect_to('/login')
200
200
  end
201
-
201
+
202
202
  it "should not let you get the update action" do
203
203
  put :update, :id => 1
204
204
  response.should redirect_to('/login')
205
205
  end
206
-
206
+
207
207
  it "should not let you get the destroy action" do
208
208
  delete :destroy, :id => 1
209
209
  response.should redirect_to('/login')
@@ -6,24 +6,24 @@ describe Forge::DispatchesController do
6
6
  describe "As an admin" do
7
7
  fixtures :users, :roles
8
8
  before do
9
- controller.stub!(:current_user).and_return(users(:admin))
9
+ controller.stub(:current_user).and_return(users(:admin))
10
10
  end
11
-
11
+
12
12
  # NEW
13
13
  describe "GET dispatches/new" do
14
14
  before do
15
15
  get :new
16
16
  end
17
-
17
+
18
18
  it "should assign @dispatch" do
19
19
  assigns[:dispatch].should_not be_nil
20
20
  end
21
-
21
+
22
22
  it "should render the new template" do
23
23
  response.should render_template('new')
24
24
  end
25
25
  end
26
-
26
+
27
27
  # EDIT
28
28
  describe "GET dispatches/:id/edit" do
29
29
  before do
@@ -31,172 +31,172 @@ describe Forge::DispatchesController do
31
31
  Dispatch.should_receive(:find).with("1").and_return(@dispatch)
32
32
  get :edit, :id => 1
33
33
  end
34
-
34
+
35
35
  it "should assign @dispatch" do
36
36
  assigns[:dispatch].should == @dispatch
37
37
  end
38
-
38
+
39
39
  it "should render the edit template" do
40
40
  response.should render_template('edit')
41
41
  end
42
42
  end
43
-
43
+
44
44
 
45
45
  # CREATE
46
46
  describe "POST dispatches/" do
47
47
  def do_create
48
48
  post :create, :dispatch => {}
49
49
  end
50
-
51
- describe "with valid attributes" do
50
+
51
+ describe "with valid attributes" do
52
52
  before do
53
53
  @dispatch = mock_model(Dispatch, :save => true)
54
- Dispatch.stub!(:new).and_return(@dispatch)
54
+ Dispatch.stub(:new).and_return(@dispatch)
55
55
  end
56
-
56
+
57
57
  it "should assign @dispatch" do
58
58
  do_create
59
59
  assigns[:dispatch].should == @dispatch
60
60
  end
61
-
61
+
62
62
  it "should set the flash notice" do
63
63
  do_create
64
64
  flash[:notice].should_not be_nil
65
65
  end
66
-
66
+
67
67
  it "should redirect to the index" do
68
68
  do_create
69
69
  response.should redirect_to(forge_dispatches_path)
70
70
  end
71
-
71
+
72
72
  it "should be valid" do
73
73
  @dispatch.should_receive(:save).and_return(:true)
74
74
  do_create
75
75
  end
76
76
  end
77
-
77
+
78
78
  describe "with invalid attributes" do
79
79
  before do
80
80
  @dispatch = mock_model(Dispatch, :save => false)
81
- Dispatch.stub!(:new).and_return(@dispatch)
81
+ Dispatch.stub(:new).and_return(@dispatch)
82
82
  end
83
-
83
+
84
84
  it "should assign @dispatch" do
85
85
  do_create
86
86
  assigns[:dispatch].should == @dispatch
87
87
  end
88
-
88
+
89
89
  it "should not set the flash notice" do
90
90
  do_create
91
91
  flash[:notice].should be_nil
92
92
  end
93
-
93
+
94
94
  it "should render the new template" do
95
95
  do_create
96
96
  response.should render_template('new')
97
97
  end
98
-
98
+
99
99
  it "should not save" do
100
100
  @dispatch.should_receive(:save).and_return(:false)
101
101
  do_create
102
102
  end
103
103
  end
104
104
  end
105
-
105
+
106
106
  # UPDATE
107
107
  describe "PUT dispatches/:id" do
108
108
  def do_update
109
109
  put :update, :id => "1", :dispatch => {}
110
- end
111
-
110
+ end
111
+
112
112
  describe "with valid params" do
113
113
  before(:each) do
114
114
  @dispatch = mock_model(Dispatch, :update_attributes => true)
115
- Dispatch.stub!(:find).with("1").and_return(@dispatch)
115
+ Dispatch.stub(:find).with("1").and_return(@dispatch)
116
116
  end
117
-
117
+
118
118
  it "should find dispatch and return object" do
119
119
  do_update
120
120
  assigns[:dispatch].should == @dispatch
121
121
  end
122
-
122
+
123
123
  it "should update the dispatch object's attributes" do
124
124
  @dispatch.should_receive(:update_attributes)
125
125
  do_update
126
126
  end
127
-
127
+
128
128
  it "should redirect to the dispatch index page" do
129
129
  do_update
130
130
  response.should redirect_to(forge_dispatches_path)
131
131
  end
132
132
  end
133
-
133
+
134
134
  describe "with invalid params" do
135
135
  before(:each) do
136
136
  @dispatch = mock_model(Dispatch, :update_attributes => false)
137
- Dispatch.stub!(:find).with("1").and_return(@dispatch)
137
+ Dispatch.stub(:find).with("1").and_return(@dispatch)
138
138
  end
139
-
139
+
140
140
  it "should find dispatch and return object" do
141
141
  do_update
142
142
  assigns[:dispatch].should == @dispatch
143
143
  end
144
-
144
+
145
145
  it "should update the dispatch object's attributes" do
146
146
  @dispatch.should_receive(:update_attributes)
147
147
  do_update
148
148
  end
149
-
149
+
150
150
  it "should render the edit form" do
151
151
  do_update
152
152
  response.should render_template('edit')
153
153
  end
154
-
154
+
155
155
  it "should not have a flash notice" do
156
156
  do_update
157
157
  flash[:notice].should be_blank
158
158
  end
159
159
  end
160
-
160
+
161
161
  end
162
-
162
+
163
163
  # DESTROY
164
164
  describe "DELETE /dispatches/:id" do
165
165
  it "should delete" do
166
166
  @dispatch = mock_model(Dispatch)
167
- Dispatch.stub!(:find).and_return(@dispatch)
167
+ Dispatch.stub(:find).and_return(@dispatch)
168
168
  @dispatch.should_receive(:destroy)
169
169
  delete :destroy, :id => 1
170
170
  end
171
171
  end
172
172
  end
173
-
174
-
173
+
174
+
175
175
  describe "As someone who's not logged in" do
176
176
  before do
177
- controller.stub!(:current_user).and_return(nil)
177
+ controller.stub(:current_user).and_return(nil)
178
178
  end
179
-
179
+
180
180
  it "should not let you get the new action" do
181
181
  get :new
182
182
  response.should redirect_to('/login')
183
183
  end
184
-
184
+
185
185
  it "should not let you get the edit action" do
186
186
  get :edit, :id => 1
187
187
  response.should redirect_to('/login')
188
188
  end
189
-
189
+
190
190
  it "should not let you get the create action" do
191
191
  post :create
192
192
  response.should redirect_to('/login')
193
193
  end
194
-
194
+
195
195
  it "should not let you get the update action" do
196
196
  put :update, :id => 1
197
197
  response.should redirect_to('/login')
198
198
  end
199
-
199
+
200
200
  it "should not let you get the destroy action" do
201
201
  delete :destroy, :id => 1
202
202
  response.should redirect_to('/login')