spree_suppliers 0.60.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- metadata +41 -215
- data/README +0 -46
- data/Rakefile +0 -137
- data/app/controllers/admin/pickup_locations_controller.rb +0 -52
- data/app/controllers/admin/pickups_controller.rb +0 -84
- data/app/controllers/admin/shipping_options_controller.rb +0 -32
- data/app/controllers/admin/supplier_taxons_controller.rb +0 -65
- data/app/controllers/admin/suppliers_controller.rb +0 -203
- data/app/controllers/admin/vendor_overview_controller.rb +0 -18
- data/app/controllers/dash/base_controller.rb +0 -10
- data/app/controllers/dash/overview_controller.rb +0 -6
- data/app/controllers/dash/pickup_locations_controller.rb +0 -27
- data/app/controllers/dash/pickups_controller.rb +0 -40
- data/app/controllers/dash/products_controller.rb +0 -15
- data/app/controllers/messages_controller.rb +0 -17
- data/app/controllers/suppliers_controller.rb +0 -19
- data/app/controllers/user_sessions_decorator.rb +0 -39
- data/app/helpers/admin/suppliers_helper.rb +0 -21
- data/app/helpers/cities_helper.rb +0 -2
- data/app/helpers/dragonfly_helper.rb +0 -16
- data/app/helpers/messages_helper.rb +0 -2
- data/app/helpers/suppliers_helper.rb +0 -16
- data/app/mailers/supplier_mailer.rb +0 -11
- data/app/models/ability_decorator.rb +0 -19
- data/app/models/delivery.rb +0 -6
- data/app/models/hour.rb +0 -4
- data/app/models/item.rb +0 -5
- data/app/models/message.rb +0 -3
- data/app/models/pickup.rb +0 -10
- data/app/models/pickup_date.rb +0 -3
- data/app/models/pickup_location.rb +0 -7
- data/app/models/supplier.rb +0 -33
- data/app/models/supplier_invoice.rb +0 -5
- data/app/views/admin/orders/index.html.erb +0 -107
- data/app/views/admin/orders/show.html.erb +0 -35
- data/app/views/admin/orders/user.html.erb +0 -19
- data/app/views/admin/pickup_locations/_pickup_location.html.erb +0 -10
- data/app/views/admin/pickup_locations/edit.html.erb +0 -44
- data/app/views/admin/pickup_locations/new.html.erb +0 -48
- data/app/views/admin/pickup_locations/show.html.erb +0 -1
- data/app/views/admin/pickups/_pickup.erb +0 -0
- data/app/views/admin/pickups/index.html.erb +0 -44
- data/app/views/admin/pickups/new.html.erb +0 -33
- data/app/views/admin/pickups/show.html.erb +0 -42
- data/app/views/admin/products/_suppliers_form.html.erb +0 -5
- data/app/views/admin/shared/_order_tabs_decide.html.erb +0 -5
- data/app/views/admin/shared/_vendor_order_tabs.html.erb +0 -39
- data/app/views/admin/shipping_options/edit.html.erb +0 -38
- data/app/views/admin/supplier_taxons/_form.html.erb +0 -23
- data/app/views/admin/supplier_taxons/_taxon_table.html.erb +0 -23
- data/app/views/admin/supplier_taxons/available.js.erb +0 -33
- data/app/views/admin/supplier_taxons/edit.html.erb +0 -11
- data/app/views/admin/supplier_taxons/remove.html.erb +0 -1
- data/app/views/admin/supplier_taxons/select.js.erb +0 -2
- data/app/views/admin/supplier_taxons/selected.html.erb +0 -51
- data/app/views/admin/suppliers/_edit_form.html.erb +0 -75
- data/app/views/admin/suppliers/_edit_hours_form.html.erb +0 -18
- data/app/views/admin/suppliers/_form.html.erb +0 -72
- data/app/views/admin/suppliers/_hours_form.html.erb +0 -11
- data/app/views/admin/suppliers/_image_form.html.erb +0 -40
- data/app/views/admin/suppliers/_supplier.html.erb +0 -37
- data/app/views/admin/suppliers/_supplier_tabs.html.erb +0 -18
- data/app/views/admin/suppliers/_suppliers_table.html.erb +0 -25
- data/app/views/admin/suppliers/_upload_image.html.erb +0 -14
- data/app/views/admin/suppliers/available.js.erb +0 -34
- data/app/views/admin/suppliers/edit.html.erb +0 -20
- data/app/views/admin/suppliers/index.html.erb +0 -102
- data/app/views/admin/suppliers/line_items.html.erb +0 -20
- data/app/views/admin/suppliers/new.html.erb +0 -22
- data/app/views/admin/suppliers/remove.html.erb +0 -1
- data/app/views/admin/suppliers/select.html.erb +0 -1
- data/app/views/admin/suppliers/selected.html.erb +0 -40
- data/app/views/admin/suppliers/show.html.erb +0 -2
- data/app/views/admin/users/_form.html.erb +0 -40
- data/app/views/admin/vendor_overview/index.html.erb +0 -1
- data/app/views/checkout/_delivery.html.erb +0 -5
- data/app/views/dash/overview/index.html.erb +0 -58
- data/app/views/dash/pickup_locations/_pickup_location.html.erb +0 -3
- data/app/views/dash/pickup_locations/new.html.erb +0 -47
- data/app/views/dash/pickups/_pickup.erb +0 -3
- data/app/views/dash/pickups/new.html.erb +0 -24
- data/app/views/dash/products/new.html.erb +0 -38
- data/app/views/layouts/admin.html.erb +0 -81
- data/app/views/messages/_message_form.html.erb +0 -17
- data/app/views/messages/create.html.erb +0 -2
- data/app/views/messages/destroy.html.erb +0 -2
- data/app/views/messages/new.html.erb +0 -2
- data/app/views/shared/_deliveries.html.erb +0 -113
- data/app/views/shared/_hours.html.erb +0 -21
- data/app/views/shared/_products_vendor.html.erb +0 -49
- data/app/views/shared/_supplier_invoices.html.erb +0 -67
- data/app/views/supplier_mailer/invoice_email.html.erb +0 -72
- data/app/views/suppliers/_supplier.html.erb +0 -7
- data/app/views/suppliers/_supplier_list.erb +0 -20
- data/app/views/suppliers/index.html.erb +0 -17
- data/app/views/suppliers/show.html.erb +0 -106
- data/app/views/suppliers/supplier_list.erb +0 -14
- data/config/initializers/dragonfly.rb +0 -8
- data/config/initializers/supplier_invoice_mailer.rb +0 -10
- data/config/locales/en-US.yml +0 -13
- data/config/routes.rb +0 -48
- data/db/migrate/20091209201716_supplier_setup.rb +0 -36
- data/db/migrate/20110922213437_create_messages.rb +0 -18
- data/db/migrate/20110928203155_create_hours.rb +0 -21
- data/db/migrate/20111006185052_create_pickups.rb +0 -17
- data/db/migrate/20111010191125_add_location_to_addresses.rb +0 -9
- data/db/migrate/20111010214313_create_pickup_dates.rb +0 -14
- data/db/migrate/20111011180211_add_supplier_id_to_user.rb +0 -9
- data/db/migrate/20111012211422_create_pickup_locations.rb +0 -21
- data/db/migrate/20111013155257_create_supplier_invoices.rb +0 -16
- data/db/migrate/20111013161225_create_items.rb +0 -18
- data/db/migrate/20111018133543_add_attributes_to_products.rb +0 -17
- data/db/migrate/20111028190454_add_attributes_to_assets.rb +0 -11
- data/db/migrate/20111029230805_create_suppliers_taxons.rb +0 -16
- data/db/migrate/20111101165933_create_deliveries.rb +0 -17
- data/db/migrate/20111108213108_create_shipping_methods_suppliers.rb +0 -16
- data/db/seeds.rb +0 -14
- data/lib/spree_suppliers.rb +0 -411
- data/lib/spree_suppliers_hooks.rb +0 -40
- data/lib/tasks/spree_suppliers.rake +0 -27
- data/public/javascripts/jquery-ui.js +0 -312
- data/public/javascripts/jquery-ui.multidatespicker.js +0 -398
- data/public/javascripts/jquery.ui.datepicker.js +0 -1791
- data/public/stylesheets/suppliers.css +0 -676
- data/spec/controllers/cities_controller_spec.rb +0 -157
- data/spec/controllers/shipping_options_controller_spec.rb +0 -12
- data/spec/helpers/cities_helper_spec.rb +0 -15
- data/spec/models/city_spec.rb +0 -5
- data/spec/models/comment_spec.rb +0 -64
- data/spec/models/item_spec.rb +0 -5
- data/spec/models/message_spec.rb +0 -5
- data/spec/models/pickup_date_spec.rb +0 -5
- data/spec/models/pickup_location_spec.rb +0 -5
- data/spec/models/pickup_spec.rb +0 -5
- data/spec/models/rating_spec.rb +0 -24
- data/spec/models/supplier_invoice_spec.rb +0 -5
- data/spec/models/supplier_spec.rb +0 -11
- data/spec/requests/cities_spec.rb +0 -11
- data/spec/routing/cities_routing_spec.rb +0 -35
- data/spec/spec.opts +0 -6
- data/spec/spec_helper.rb +0 -37
- data/spec/views/cities/edit.html.erb_spec.rb +0 -22
- data/spec/views/cities/index.html.erb_spec.rb +0 -28
- data/spec/views/cities/new.html.erb_spec.rb +0 -22
- data/spec/views/cities/show.html.erb_spec.rb +0 -21
- data/spec/views/shipping_options/edit.html.erb_spec.rb +0 -5
- 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,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
|
data/spec/models/city_spec.rb
DELETED
data/spec/models/comment_spec.rb
DELETED
@@ -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
|
data/spec/models/item_spec.rb
DELETED
data/spec/models/message_spec.rb
DELETED
data/spec/models/pickup_spec.rb
DELETED
data/spec/models/rating_spec.rb
DELETED
@@ -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,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
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
|