Permalink
Browse files

testing bundling

  • Loading branch information...
1 parent eb2703b commit 15ff41f8dad963a279c773da1d847d071ffc37ee @mattetti committed Nov 7, 2008
@@ -4,25 +4,25 @@ def authenticated_articles_route_spec
spec_file = "#{path}/spec/requests/articles_spec.rb"
print " > editing requests spec #{spec_file}\n"
-
- old_given = <<-RUBY
- given "a article exists" do
- Article.all.destroy!
- request(resource(:articles), :method => "POST",
- :params => { :article => {:title => 'intro', :author => 'Matt', :created_at => '2008-11-07 10:07:12' }})
- end
- RUBY
+ old_given = <<RUBY
+ given "a article exists" do
+ Article.all.destroy!
+ request(resource(:articles), :method => "POST",
+ :params => { :article => { :id => nil }})
+ end
+RUBY
gsub_file spec_file, /(#{Regexp.escape(old_given)})/mi do |match|
<<-RUBY
given "a article exists" do
Article.all.destroy!
- request(resource(:articles), :method => "POST",
- :params => { :article => {:title => 'intro', :author => 'Matt', :created_at => '2008-11-07 10:07:12' }})
User.all.detroy!
u = User.new(:login => "mattetti")
u.password = u.password_confirmation = "sekrit"
u.save
+ request("/login", :method => "put", :params => {"login" => "mattetti", "password" => "sekrit"})
+ request(resource(:articles), :method => "POST",
+ :params => { :article => {:title => 'intro', :author => 'Matt', :created_at => '2008-11-07 10:07:12' }})
end
RUBY
end
@@ -0,0 +1,10 @@
+module Step
+
+ def run_bundled_app_specs
+ Dir.chdir(path) do
+ puts "cd #{name} && bin/rake spec --trace\n"
+ puts `bin/rake spec --trace`
+ end
+ end
+
+end
@@ -95,12 +95,12 @@ class App < Thor
step :add_model_validation
step :add_model_specs
step :edit_layout
- step :authenticate_articles_route
- step :run_app_specs
- step :authenticated_articles_route_spec
- step :run_app_specs
+ # step :authenticate_articles_route
+ # step :run_app_specs
+ # step :authenticated_articles_route_spec
+ # step :run_app_specs
step :bundling_merb
- step :run_app_specs
+ step :run_bundled_app_specs
end
end

0 comments on commit 15ff41f

Please sign in to comment.