vrfs-774: changing country value from USA to US for max_mind_geo support
This commit is contained in:
parent
d045ae4b53
commit
291a3a8ac2
|
|
@ -9,7 +9,7 @@ FactoryGirl.define do
|
|||
musician true
|
||||
city "Apex"
|
||||
state "NC"
|
||||
country "USA"
|
||||
country "US"
|
||||
terms_of_service true
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ alter table users alter column birth_date drop not null;
|
|||
update users set state = 'NC';
|
||||
alter table users alter column state set not null;
|
||||
|
||||
update users set country = 'USA';
|
||||
update users set country = 'US';
|
||||
alter table users alter column country set not null;
|
||||
|
||||
alter table bands alter column city drop default;
|
||||
|
|
@ -15,7 +15,7 @@ alter table bands alter column city drop default;
|
|||
update users set state = 'NC';
|
||||
alter table bands alter column state set not null;
|
||||
|
||||
update users set country = 'USA';
|
||||
update users set country = 'US';
|
||||
alter table bands alter column country set not null;
|
||||
|
||||
--alter table users drop column account_id;
|
||||
|
|
|
|||
|
|
@ -7,3 +7,5 @@ ALTER TABLE max_mind_geo DROP COLUMN ip_bottom;
|
|||
ALTER TABLE max_mind_geo DROP COLUMN ip_top;
|
||||
ALTER TABLE max_mind_geo ADD COLUMN ip_start INET;
|
||||
ALTER TABLE max_mind_geo ADD COLUMN ip_end INET;
|
||||
|
||||
UPDATE users SET country = 'US' WHERE country = 'USA';
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ FactoryGirl.define do
|
|||
musician true
|
||||
city "Apex"
|
||||
state "NC"
|
||||
country "USA"
|
||||
country "US"
|
||||
terms_of_service true
|
||||
subscribe_email true
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ FactoryGirl.define do
|
|||
musician false
|
||||
city "Apex"
|
||||
state "NC"
|
||||
country "USA"
|
||||
country "US"
|
||||
terms_of_service true
|
||||
end
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ FactoryGirl.define do
|
|||
biography "Established 1978"
|
||||
city "Apex"
|
||||
state "NC"
|
||||
country "USA"
|
||||
country "US"
|
||||
end
|
||||
|
||||
factory :join_request, :class => JamRuby::JoinRequest do
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ describe "Band API", :type => :api do
|
|||
|
||||
it "should allow band creation" do
|
||||
|
||||
last_response = create_band(user, "My Band", "http://www.myband.com", "Bio", "Apex", "NC", "USA", ["country"], "www.photos.com", "www.logos.com")
|
||||
last_response = create_band(user, "My Band", "http://www.myband.com", "Bio", "Apex", "NC", "US", ["country"], "www.photos.com", "www.logos.com")
|
||||
last_response.status.should == 201
|
||||
|
||||
new_band = JSON.parse(last_response.body)
|
||||
|
|
@ -117,14 +117,14 @@ describe "Band API", :type => :api do
|
|||
end
|
||||
|
||||
it "should prevent bands with less than 1 genre" do
|
||||
last_response = create_band(user, "My Band", "http://www.myband.com", "Bio", "Apex", "NC", "USA", nil, "www.photos.com", "www.logos.com")
|
||||
last_response = create_band(user, "My Band", "http://www.myband.com", "Bio", "Apex", "NC", "US", nil, "www.photos.com", "www.logos.com")
|
||||
last_response.status.should == 400
|
||||
error_msg = JSON.parse(last_response.body)
|
||||
error_msg["message"].should == ValidationMessages::GENRE_MINIMUM_NOT_MET
|
||||
end
|
||||
|
||||
it "should prevent bands with more than 1 genre" do
|
||||
last_response = create_band(user, "My Band", "http://www.myband.com", "Bio", "Apex", "NC", "USA", ["african", "country"], "www.photos.com", "www.logos.com")
|
||||
last_response = create_band(user, "My Band", "http://www.myband.com", "Bio", "Apex", "NC", "US", ["african", "country"], "www.photos.com", "www.logos.com")
|
||||
last_response.status.should == 400
|
||||
error_msg = JSON.parse(last_response.body)
|
||||
error_msg["message"].should == ValidationMessages::GENRE_LIMIT_EXCEEDED
|
||||
|
|
@ -145,7 +145,7 @@ describe "Band API", :type => :api do
|
|||
|
||||
band.genres.size.should == 1
|
||||
|
||||
last_response = update_band(user, band.id, "Brian's Band", "http://www.briansband.com", "Bio", "Apex", "NC", "USA", ["african"], "www.photos.com", "www.logos.com")
|
||||
last_response = update_band(user, band.id, "Brian's Band", "http://www.briansband.com", "Bio", "Apex", "NC", "US", ["african"], "www.photos.com", "www.logos.com")
|
||||
last_response.status.should == 200
|
||||
|
||||
updated_band = JSON.parse(last_response.body)
|
||||
|
|
@ -319,4 +319,4 @@ describe "Band API", :type => :api do
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ describe "Search API", :type => :api do
|
|||
it "simple search" do
|
||||
@musician = FactoryGirl.create(:user, first_name: "Peach", last_name: "Nothing", email: "user@example.com", musician: true)
|
||||
@fan = FactoryGirl.create(:user, first_name: "Peach Peach", last_name: "Grovery", email: "fan@example.com", musician: false)
|
||||
@band = Band.save(nil, "Peach pit", "www.bands.com", "zomg we rock", "Apex", "NC", "USA", ["hip hop"], user.id, nil, nil)
|
||||
@band2 = Band.save(nil, "Peach", "www.bands2.com", "zomg we rock", "Apex", "NC", "USA", ["hip hop"], user.id, nil, nil)
|
||||
@band = Band.save(nil, "Peach pit", "www.bands.com", "zomg we rock", "Apex", "NC", "US", ["hip hop"], user.id, nil, nil)
|
||||
@band2 = Band.save(nil, "Peach", "www.bands2.com", "zomg we rock", "Apex", "NC", "US", ["hip hop"], user.id, nil, nil)
|
||||
|
||||
get '/api/search.json?query=peach'
|
||||
last_response.status.should == 200
|
||||
|
|
|
|||
Loading…
Reference in New Issue