spree_suppliers 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. metadata +14 -182
  2. data/README.markdown +0 -84
  3. data/Rakefile +0 -137
  4. data/app/controllers/admin/pickup_locations_controller.rb +0 -52
  5. data/app/controllers/admin/pickups_controller.rb +0 -84
  6. data/app/controllers/admin/shipping_options_controller.rb +0 -32
  7. data/app/controllers/admin/supplier_taxons_controller.rb +0 -65
  8. data/app/controllers/admin/suppliers_controller.rb +0 -203
  9. data/app/controllers/admin/vendor_overview_controller.rb +0 -18
  10. data/app/controllers/dash/base_controller.rb +0 -10
  11. data/app/controllers/dash/overview_controller.rb +0 -6
  12. data/app/controllers/dash/pickup_locations_controller.rb +0 -27
  13. data/app/controllers/dash/pickups_controller.rb +0 -40
  14. data/app/controllers/dash/products_controller.rb +0 -15
  15. data/app/controllers/messages_controller.rb +0 -17
  16. data/app/controllers/suppliers_controller.rb +0 -19
  17. data/app/controllers/user_sessions_decorator.rb +0 -39
  18. data/app/helpers/admin/suppliers_helper.rb +0 -21
  19. data/app/helpers/cities_helper.rb +0 -2
  20. data/app/helpers/dragonfly_helper.rb +0 -16
  21. data/app/helpers/messages_helper.rb +0 -2
  22. data/app/helpers/suppliers_helper.rb +0 -16
  23. data/app/mailers/supplier_mailer.rb +0 -11
  24. data/app/models/ability_decorator.rb +0 -19
  25. data/app/models/delivery.rb +0 -6
  26. data/app/models/hour.rb +0 -4
  27. data/app/models/item.rb +0 -5
  28. data/app/models/message.rb +0 -3
  29. data/app/models/pickup.rb +0 -10
  30. data/app/models/pickup_date.rb +0 -3
  31. data/app/models/pickup_location.rb +0 -7
  32. data/app/models/supplier.rb +0 -33
  33. data/app/models/supplier_invoice.rb +0 -5
  34. data/app/views/admin/orders/index.html.erb +0 -107
  35. data/app/views/admin/orders/show.html.erb +0 -35
  36. data/app/views/admin/orders/user.html.erb +0 -19
  37. data/app/views/admin/pickup_locations/_pickup_location.html.erb +0 -10
  38. data/app/views/admin/pickup_locations/edit.html.erb +0 -44
  39. data/app/views/admin/pickup_locations/new.html.erb +0 -48
  40. data/app/views/admin/pickup_locations/show.html.erb +0 -1
  41. data/app/views/admin/pickups/_pickup.erb +0 -0
  42. data/app/views/admin/pickups/index.html.erb +0 -44
  43. data/app/views/admin/pickups/new.html.erb +0 -33
  44. data/app/views/admin/pickups/show.html.erb +0 -42
  45. data/app/views/admin/products/_suppliers_form.html.erb +0 -5
  46. data/app/views/admin/shared/_order_tabs_decide.html.erb +0 -5
  47. data/app/views/admin/shared/_vendor_order_tabs.html.erb +0 -39
  48. data/app/views/admin/shipping_options/edit.html.erb +0 -38
  49. data/app/views/admin/supplier_taxons/_form.html.erb +0 -23
  50. data/app/views/admin/supplier_taxons/_taxon_table.html.erb +0 -23
  51. data/app/views/admin/supplier_taxons/available.js.erb +0 -33
  52. data/app/views/admin/supplier_taxons/edit.html.erb +0 -11
  53. data/app/views/admin/supplier_taxons/remove.html.erb +0 -1
  54. data/app/views/admin/supplier_taxons/select.js.erb +0 -2
  55. data/app/views/admin/supplier_taxons/selected.html.erb +0 -51
  56. data/app/views/admin/suppliers/_edit_form.html.erb +0 -75
  57. data/app/views/admin/suppliers/_edit_hours_form.html.erb +0 -18
  58. data/app/views/admin/suppliers/_form.html.erb +0 -72
  59. data/app/views/admin/suppliers/_hours_form.html.erb +0 -11
  60. data/app/views/admin/suppliers/_image_form.html.erb +0 -40
  61. data/app/views/admin/suppliers/_supplier.html.erb +0 -37
  62. data/app/views/admin/suppliers/_supplier_tabs.html.erb +0 -18
  63. data/app/views/admin/suppliers/_suppliers_table.html.erb +0 -25
  64. data/app/views/admin/suppliers/_upload_image.html.erb +0 -14
  65. data/app/views/admin/suppliers/available.js.erb +0 -34
  66. data/app/views/admin/suppliers/edit.html.erb +0 -20
  67. data/app/views/admin/suppliers/index.html.erb +0 -102
  68. data/app/views/admin/suppliers/line_items.html.erb +0 -20
  69. data/app/views/admin/suppliers/new.html.erb +0 -22
  70. data/app/views/admin/suppliers/remove.html.erb +0 -1
  71. data/app/views/admin/suppliers/select.html.erb +0 -1
  72. data/app/views/admin/suppliers/selected.html.erb +0 -40
  73. data/app/views/admin/suppliers/show.html.erb +0 -2
  74. data/app/views/admin/users/_form.html.erb +0 -40
  75. data/app/views/admin/vendor_overview/index.html.erb +0 -1
  76. data/app/views/checkout/_delivery.html.erb +0 -5
  77. data/app/views/dash/overview/index.html.erb +0 -58
  78. data/app/views/dash/pickup_locations/_pickup_location.html.erb +0 -3
  79. data/app/views/dash/pickup_locations/new.html.erb +0 -47
  80. data/app/views/dash/pickups/_pickup.erb +0 -3
  81. data/app/views/dash/pickups/new.html.erb +0 -24
  82. data/app/views/dash/products/new.html.erb +0 -38
  83. data/app/views/layouts/admin.html.erb +0 -81
  84. data/app/views/messages/_message_form.html.erb +0 -17
  85. data/app/views/messages/create.html.erb +0 -2
  86. data/app/views/messages/destroy.html.erb +0 -2
  87. data/app/views/messages/new.html.erb +0 -2
  88. data/app/views/shared/_deliveries.html.erb +0 -113
  89. data/app/views/shared/_hours.html.erb +0 -21
  90. data/app/views/shared/_products_vendor.html.erb +0 -49
  91. data/app/views/shared/_supplier_invoices.html.erb +0 -67
  92. data/app/views/supplier_mailer/invoice_email.html.erb +0 -72
  93. data/app/views/suppliers/_supplier.html.erb +0 -7
  94. data/app/views/suppliers/_supplier_list.erb +0 -20
  95. data/app/views/suppliers/index.html.erb +0 -17
  96. data/app/views/suppliers/show.html.erb +0 -106
  97. data/app/views/suppliers/supplier_list.erb +0 -14
  98. data/config/initializers/dragonfly.rb +0 -8
  99. data/config/initializers/supplier_invoice_mailer.rb +0 -10
  100. data/config/locales/en-US.yml +0 -13
  101. data/config/routes.rb +0 -48
  102. data/db/migrate/20091209201716_supplier_setup.rb +0 -36
  103. data/db/migrate/20110922213437_create_messages.rb +0 -18
  104. data/db/migrate/20110928203155_create_hours.rb +0 -21
  105. data/db/migrate/20111006185052_create_pickups.rb +0 -17
  106. data/db/migrate/20111010191125_add_location_to_addresses.rb +0 -9
  107. data/db/migrate/20111010214313_create_pickup_dates.rb +0 -14
  108. data/db/migrate/20111011180211_add_supplier_id_to_user.rb +0 -9
  109. data/db/migrate/20111012211422_create_pickup_locations.rb +0 -21
  110. data/db/migrate/20111013155257_create_supplier_invoices.rb +0 -16
  111. data/db/migrate/20111013161225_create_items.rb +0 -18
  112. data/db/migrate/20111018133543_add_attributes_to_products.rb +0 -17
  113. data/db/migrate/20111028190454_add_attributes_to_assets.rb +0 -11
  114. data/db/migrate/20111029230805_create_suppliers_taxons.rb +0 -16
  115. data/db/migrate/20111101165933_create_deliveries.rb +0 -17
  116. data/db/migrate/20111108213108_create_shipping_methods_suppliers.rb +0 -16
  117. data/db/seeds.rb +0 -14
  118. data/lib/spree_suppliers.rb +0 -411
  119. data/lib/spree_suppliers_hooks.rb +0 -40
  120. data/lib/tasks/spree_suppliers.rake +0 -27
  121. data/public/javascripts/jquery-ui.js +0 -312
  122. data/public/javascripts/jquery-ui.multidatespicker.js +0 -398
  123. data/public/javascripts/jquery.ui.datepicker.js +0 -1791
  124. data/public/stylesheets/suppliers.css +0 -676
  125. data/spec/controllers/cities_controller_spec.rb +0 -157
  126. data/spec/controllers/shipping_options_controller_spec.rb +0 -12
  127. data/spec/helpers/cities_helper_spec.rb +0 -15
  128. data/spec/models/city_spec.rb +0 -5
  129. data/spec/models/comment_spec.rb +0 -64
  130. data/spec/models/item_spec.rb +0 -5
  131. data/spec/models/message_spec.rb +0 -5
  132. data/spec/models/pickup_date_spec.rb +0 -5
  133. data/spec/models/pickup_location_spec.rb +0 -5
  134. data/spec/models/pickup_spec.rb +0 -5
  135. data/spec/models/rating_spec.rb +0 -24
  136. data/spec/models/supplier_invoice_spec.rb +0 -5
  137. data/spec/models/supplier_spec.rb +0 -11
  138. data/spec/requests/cities_spec.rb +0 -11
  139. data/spec/routing/cities_routing_spec.rb +0 -35
  140. data/spec/spec.opts +0 -6
  141. data/spec/spec_helper.rb +0 -37
  142. data/spec/views/cities/edit.html.erb_spec.rb +0 -22
  143. data/spec/views/cities/index.html.erb_spec.rb +0 -28
  144. data/spec/views/cities/new.html.erb_spec.rb +0 -22
  145. data/spec/views/cities/show.html.erb_spec.rb +0 -21
  146. data/spec/views/shipping_options/edit.html.erb_spec.rb +0 -5
  147. data/spree_suppliers-0.60.3.gem +0 -0
  148. data/spree_suppliers.gemspec +0 -24
@@ -1,157 +0,0 @@
1
- require 'spec_helper'
2
-
3
- # This spec was generated by rspec-rails when you ran the scaffold generator.
4
- # It demonstrates how one might use RSpec to specify the controller code that
5
- # was generated by Rails when you ran the scaffold generator.
6
- #
7
- # It assumes that the implementation code is generated by the rails scaffold
8
- # generator. If you are using any extension libraries to generate different
9
- # controller code, this generated spec may or may not pass.
10
- #
11
- # It only uses APIs available in rails and/or rspec-rails. There are a number
12
- # of tools you can use to make these specs even more expressive, but we're
13
- # sticking to rails and rspec-rails APIs to keep things simple and stable.
14
- #
15
- # Compared to earlier versions of this generator, there is very limited use of
16
- # stubs and message expectations in this spec. Stubs are only used when there
17
- # is no simpler way to get a handle on the object needed for the example.
18
- # Message expectations are only used when there is no simpler way to specify
19
- # that an instance is receiving a specific message.
20
-
21
- describe CitiesController do
22
-
23
- # This should return the minimal set of attributes required to create a valid
24
- # City. As you add validations to City, be sure to
25
- # update the return value of this method accordingly.
26
- def valid_attributes
27
- {}
28
- end
29
-
30
- describe "GET index" do
31
- it "assigns all cities as @cities" do
32
- city = City.create! valid_attributes
33
- get :index
34
- assigns(:cities).should eq([city])
35
- end
36
- end
37
-
38
- describe "GET show" do
39
- it "assigns the requested city as @city" do
40
- city = City.create! valid_attributes
41
- get :show, :id => city.id.to_s
42
- assigns(:city).should eq(city)
43
- end
44
- end
45
-
46
- describe "GET new" do
47
- it "assigns a new city as @city" do
48
- get :new
49
- assigns(:city).should be_a_new(City)
50
- end
51
- end
52
-
53
- describe "GET edit" do
54
- it "assigns the requested city as @city" do
55
- city = City.create! valid_attributes
56
- get :edit, :id => city.id.to_s
57
- assigns(:city).should eq(city)
58
- end
59
- end
60
-
61
- describe "POST create" do
62
- describe "with valid params" do
63
- it "creates a new City" do
64
- expect {
65
- post :create, :city => valid_attributes
66
- }.to change(City, :count).by(1)
67
- end
68
-
69
- it "assigns a newly created city as @city" do
70
- post :create, :city => valid_attributes
71
- assigns(:city).should be_a(City)
72
- assigns(:city).should be_persisted
73
- end
74
-
75
- it "redirects to the created city" do
76
- post :create, :city => valid_attributes
77
- response.should redirect_to(City.last)
78
- end
79
- end
80
-
81
- describe "with invalid params" do
82
- it "assigns a newly created but unsaved city as @city" do
83
- # Trigger the behavior that occurs when invalid params are submitted
84
- City.any_instance.stub(:save).and_return(false)
85
- post :create, :city => {}
86
- assigns(:city).should be_a_new(City)
87
- end
88
-
89
- it "re-renders the 'new' template" do
90
- # Trigger the behavior that occurs when invalid params are submitted
91
- City.any_instance.stub(:save).and_return(false)
92
- post :create, :city => {}
93
- response.should render_template("new")
94
- end
95
- end
96
- end
97
-
98
- describe "PUT update" do
99
- describe "with valid params" do
100
- it "updates the requested city" do
101
- city = City.create! valid_attributes
102
- # Assuming there are no other cities in the database, this
103
- # specifies that the City created on the previous line
104
- # receives the :update_attributes message with whatever params are
105
- # submitted in the request.
106
- City.any_instance.should_receive(:update_attributes).with({'these' => 'params'})
107
- put :update, :id => city.id, :city => {'these' => 'params'}
108
- end
109
-
110
- it "assigns the requested city as @city" do
111
- city = City.create! valid_attributes
112
- put :update, :id => city.id, :city => valid_attributes
113
- assigns(:city).should eq(city)
114
- end
115
-
116
- it "redirects to the city" do
117
- city = City.create! valid_attributes
118
- put :update, :id => city.id, :city => valid_attributes
119
- response.should redirect_to(city)
120
- end
121
- end
122
-
123
- describe "with invalid params" do
124
- it "assigns the city as @city" do
125
- city = City.create! valid_attributes
126
- # Trigger the behavior that occurs when invalid params are submitted
127
- City.any_instance.stub(:save).and_return(false)
128
- put :update, :id => city.id.to_s, :city => {}
129
- assigns(:city).should eq(city)
130
- end
131
-
132
- it "re-renders the 'edit' template" do
133
- city = City.create! valid_attributes
134
- # Trigger the behavior that occurs when invalid params are submitted
135
- City.any_instance.stub(:save).and_return(false)
136
- put :update, :id => city.id.to_s, :city => {}
137
- response.should render_template("edit")
138
- end
139
- end
140
- end
141
-
142
- describe "DELETE destroy" do
143
- it "destroys the requested city" do
144
- city = City.create! valid_attributes
145
- expect {
146
- delete :destroy, :id => city.id.to_s
147
- }.to change(City, :count).by(-1)
148
- end
149
-
150
- it "redirects to the cities list" do
151
- city = City.create! valid_attributes
152
- delete :destroy, :id => city.id.to_s
153
- response.should redirect_to(cities_url)
154
- end
155
- end
156
-
157
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ShippingOptionsController do
4
-
5
- describe "GET 'edit'" do
6
- it "returns http success" do
7
- get 'edit'
8
- response.should be_success
9
- end
10
- end
11
-
12
- end
@@ -1,15 +0,0 @@
1
- require 'spec_helper'
2
-
3
- # Specs in this file have access to a helper object that includes
4
- # the CitiesHelper. For example:
5
- #
6
- # describe CitiesHelper do
7
- # describe "string concat" do
8
- # it "concats two strings with spaces" do
9
- # helper.concat_strings("this","that").should == "this that"
10
- # end
11
- # end
12
- # end
13
- describe CitiesHelper do
14
- pending "add some examples to (or delete) #{__FILE__}"
15
- end
@@ -1,5 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe City do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
- end
@@ -1,64 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "Comment" do
4
- before(:each) do
5
- @article = Factory(:article)
6
- @user = User.find_by_id(@article.user_id)
7
- @attr = {
8
- :text => "Cheaper than the competition",
9
- :title => "Review",
10
- :user_id => @article.user_id,
11
- }
12
- end
13
-
14
- it "should create a comment with valid attributes" do
15
- success = Comment.new(@attr)
16
- success.should be_valid
17
- end
18
-
19
- it "should not create a comment if text is empty" do
20
- emptytext = Comment.new(@attr.merge(:text => ""))
21
- emptytext.should_not be_valid
22
- end
23
-
24
- it "should not create a comment if title is empty" do
25
- emptytitle = Comment.new(@attr.merge(:title => ""))
26
- emptytitle.should_not be_valid
27
- end
28
-
29
- it "should require a user id" do
30
- noid = Comment.new(@attr.merge(:user_id => ""))
31
- noid.should_not be_valid
32
- end
33
-
34
- describe "User association" do
35
- before(:each) do
36
- @attr.merge(:user_id => "")
37
- @comment = @user.comments.create(@attr)
38
- end
39
-
40
- it "should have a user attribute" do
41
- @comment.should respond_to(:user)
42
- end
43
-
44
- it "should have the right associated user" do
45
- @comment.user_id.should == @user.id
46
- end
47
- end
48
-
49
- describe "Article association" do
50
- before(:each) do
51
- @attr.merge(:article_id => "")
52
- @comment = @article.comments.create(@attr)
53
- end
54
-
55
- it "should have an article attribute" do
56
- @comment.should respond_to(:article)
57
- end
58
-
59
- it "should have the right associated article" do
60
- @comment.article_id.should == @article.id
61
- end
62
- end
63
-
64
- end
@@ -1,5 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Item do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
- end
@@ -1,5 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Message do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
- end
@@ -1,5 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe PickupDate do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
- end
@@ -1,5 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe PickupLocation do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
- end
@@ -1,5 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Pickup do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
- end
@@ -1,24 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe "Rating" do
4
- before(:each) do
5
- @rating = Rating.new()
6
- user = Factory(:user)
7
- product = Factory(:product)
8
- @attr = {
9
- :value => 3,
10
- :user_id => user.id,
11
- :product_id => product.id
12
- }
13
- end
14
-
15
- it "should create a rating with valid attributes" do
16
- success = Rating.new(@attr)
17
- success.should be_valid
18
- end
19
-
20
- it "should not create a rating when value is empty" do
21
- novalue = Rating.new(@attr.merge(:value => ""))
22
- novalue.should_not be_valid
23
- end
24
- end
@@ -1,5 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe SupplierInvoice do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
- end
@@ -1,11 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- describe Supplier do
4
- before(:each) do
5
- @supplier = Supplier.new
6
- end
7
-
8
- it "should be valid" do
9
- @supplier.should be_valid
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Cities" do
4
- describe "GET /cities" do
5
- it "works! (now write some real specs)" do
6
- # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
7
- get cities_path
8
- response.status.should be(200)
9
- end
10
- end
11
- end
@@ -1,35 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe CitiesController do
4
- describe "routing" do
5
-
6
- it "routes to #index" do
7
- get("/cities").should route_to("cities#index")
8
- end
9
-
10
- it "routes to #new" do
11
- get("/cities/new").should route_to("cities#new")
12
- end
13
-
14
- it "routes to #show" do
15
- get("/cities/1").should route_to("cities#show", :id => "1")
16
- end
17
-
18
- it "routes to #edit" do
19
- get("/cities/1/edit").should route_to("cities#edit", :id => "1")
20
- end
21
-
22
- it "routes to #create" do
23
- post("/cities").should route_to("cities#create")
24
- end
25
-
26
- it "routes to #update" do
27
- put("/cities/1").should route_to("cities#update", :id => "1")
28
- end
29
-
30
- it "routes to #destroy" do
31
- delete("/cities/1").should route_to("cities#destroy", :id => "1")
32
- end
33
-
34
- end
35
- end
data/spec/spec.opts DELETED
@@ -1,6 +0,0 @@
1
- --colour
2
- --format
3
- progress
4
- --loadby
5
- mtime
6
- --reverse
data/spec/spec_helper.rb DELETED
@@ -1,37 +0,0 @@
1
- unless defined? SPREE_ROOT
2
- ENV["RAILS_ENV"] = "test"
3
- case
4
- when ENV["SPREE_ENV_FILE"]
5
- require ENV["SPREE_ENV_FILE"]
6
- when File.dirname(__FILE__) =~ %r{vendor/SPREE/vendor/extensions}
7
- require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../../")}/config/environment"
8
- else
9
- require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../")}/config/environment"
10
- end
11
- end
12
- require "#{SPREE_ROOT}/spec/spec_helper"
13
-
14
- if File.directory?(File.dirname(__FILE__) + "/scenarios")
15
- Scenario.load_paths.unshift File.dirname(__FILE__) + "/scenarios"
16
- end
17
- if File.directory?(File.dirname(__FILE__) + "/matchers")
18
- Dir[File.dirname(__FILE__) + "/matchers/*.rb"].each {|file| require file }
19
- end
20
-
21
- Spec::Runner.configure do |config|
22
- # config.use_transactional_fixtures = true
23
- # config.use_instantiated_fixtures = false
24
- # config.fixture_path = RAILS_ROOT + '/spec/fixtures'
25
-
26
- # You can declare fixtures for each behaviour like this:
27
- # describe "...." do
28
- # fixtures :table_a, :table_b
29
- #
30
- # Alternatively, if you prefer to declare them only once, you can
31
- # do so here, like so ...
32
- #
33
- # config.global_fixtures = :table_a, :table_b
34
- #
35
- # If you declare global fixtures, be aware that they will be declared
36
- # for all of your examples, even those that don't use them.
37
- end
@@ -1,22 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "cities/edit.html.erb" do
4
- before(:each) do
5
- @city = assign(:city, stub_model(City,
6
- :name => "MyString",
7
- :state_id => 1,
8
- :active => false
9
- ))
10
- end
11
-
12
- it "renders the edit city form" do
13
- render
14
-
15
- # Run the generator again with the --webrat flag if you want to use webrat matchers
16
- assert_select "form", :action => cities_path(@city), :method => "post" do
17
- assert_select "input#city_name", :name => "city[name]"
18
- assert_select "input#city_state_id", :name => "city[state_id]"
19
- assert_select "input#city_active", :name => "city[active]"
20
- end
21
- end
22
- end