vrfs-774: changing country value from USA to US for max_mind_geo support

This commit is contained in:
Jonathan Kolyer 2013-11-03 01:49:51 -06:00
parent 291a3a8ac2
commit 6f9f72c9b5
8 changed files with 31 additions and 28 deletions

View File

@ -8,7 +8,7 @@ FactoryGirl.define do
email_confirmed true
city "Apex"
state "NC"
country "USA"
country "US"
musician true
terms_of_service true
@ -77,7 +77,7 @@ FactoryGirl.define do
biography "My Biography"
city "Apex"
state "NC"
country "USA"
country "US"
end
factory :genre, :class => JamRuby::Genre do
@ -110,12 +110,6 @@ FactoryGirl.define do
priority 0
end
factory :musician_instrument2, :class => JamRuby::MusicianInstrument do
instrument { Instrument.find('tuba') }
proficiency_level 1
priority 0
end
factory :invited_user, :class => JamRuby::InvitedUser do
sequence(:email) { |n| "user#{n}@someservice.com" }
autofriend false

View File

@ -12,7 +12,7 @@ describe ConnectionManager do
end
def create_user(first_name, last_name, email, options = {:musician => true})
@conn.exec("INSERT INTO users (first_name, last_name, email, musician, encrypted_password, city, state, country) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING id", [first_name, last_name, email, options[:musician], '1', 'Apex', 'NC', 'USA']) do |result|
@conn.exec("INSERT INTO users (first_name, last_name, email, musician, encrypted_password, city, state, country) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING id", [first_name, last_name, email, options[:musician], '1', 'Apex', 'NC', 'US']) do |result|
return result.getvalue(0, 0)
end
end

View File

@ -6,7 +6,7 @@ describe User do
before(:each) do
@band = Band.save(nil, "Example Band", "www.bands.com", "zomg we rock", "Apex", "NC", "USA", ["hip hop"], user.id, nil, nil)
@band = Band.save(nil, "Example Band", "www.bands.com", "zomg we rock", "Apex", "NC", "US", ["hip hop"], user.id, nil, nil)
end
@ -93,7 +93,7 @@ describe User do
end
it "should tokenize correctly" do
@band2 = 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 pit", "www.bands.com", "zomg we rock", "Apex", "NC", "US", ["hip hop"], user.id, nil, nil)
ws = Band.search("pea")
ws.length.should == 1
user_result = ws[0]
@ -102,7 +102,7 @@ describe User do
it "should not return anything with a 1 character search" do
@band2 = 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 pit", "www.bands.com", "zomg we rock", "Apex", "NC", "US", ["hip hop"], user.id, nil, nil)
ws = Band.search("pe")
ws.length.should == 1
user_result = ws[0]
@ -111,4 +111,4 @@ describe User do
ws = Band.search("p")
ws.length.should == 0
end
end
end

View File

@ -13,7 +13,7 @@ describe User do
email_confirmed: true,
city: "Apex",
state: "NC",
country: "USA"
country: "US"
}
@users = []
@users << @user1 = FactoryGirl.create(:user, params)
@ -63,17 +63,26 @@ describe User do
end
it "should find musicians with an instrument" do
@user1.musician_instruments << FactoryGirl.build(:musician_instrument2, user: @user1)
minst = FactoryGirl.create(:musician_instrument, {
:user => @user1,
:instrument => Instrument.find('tuba') })
@user1.musician_instruments << minst
@user1.reload
ii = @user1.instruments.detect { |inst| inst.id == 'tuba' }
ii.should_not be_nil
params = { :instrument => ii.id }
results = User.musician_search(params)
results.all[0].instruments.detect {|inst| inst.id=='tuba'}.id.should == ii.id
results.all.each do |rr|
rr.instruments.detect { |inst| inst.id=='tuba' }.id.should == ii.id
end
results.all.count.should == 1
end
it "should find musicians within a given distance of location" do
pending
@user1.lat.should_not == nil
params = { :distance => 10, :city => 'New York' }
results = User.musician_search(params)
results.all.count.should == 0
end
end

View File

@ -7,9 +7,9 @@ describe Search do
def create_peachy_data
@user = FactoryGirl.create(:user, first_name: "Peach", last_name: "Pit", email: "user@example.com", musician: true, city: "Apex", state: "NC", country:"USA")
@fan = FactoryGirl.create(:user, first_name: "Peach Peach", last_name: "Pit", email: "fan@example.com", musician: false, city: "Apex", state: "NC", country:"USA")
@band = FactoryGirl.create(:band, name: "Peach pit", website: "www.bands.com", biography: "zomg we rock", city: "Apex", state: "NC", country:"USA")
@user = FactoryGirl.create(:user, first_name: "Peach", last_name: "Pit", email: "user@example.com", musician: true, city: "Apex", state: "NC", country:"US")
@fan = FactoryGirl.create(:user, first_name: "Peach Peach", last_name: "Pit", email: "fan@example.com", musician: false, city: "Apex", state: "NC", country:"US")
@band = FactoryGirl.create(:band, name: "Peach pit", website: "www.bands.com", biography: "zomg we rock", city: "Apex", state: "NC", country:"US")
end
def assert_peachy_data

View File

@ -5,7 +5,7 @@ describe User do
before(:each) do
@user = FactoryGirl.create(:user, first_name: "Example", last_name: "User", email: "user@example.com",
password: "foobar", password_confirmation: "foobar", musician: true, email_confirmed: true,
city: "Apex", state: "NC", country: "USA")
city: "Apex", state: "NC", country: "US")
end
it "should allow search of one user" do
@ -54,7 +54,7 @@ describe User do
it "should tokenize correctly" do
@user2 = FactoryGirl.create(:user, first_name: "peaches", last_name: "test", email: "peach@example.com",
password: "foobar", password_confirmation: "foobar", musician: true, email_confirmed: true,
city: "Apex", state: "NC", country: "USA")
city: "Apex", state: "NC", country: "US")
ws = User.search("pea")
ws.length.should == 1
user_result = ws[0]
@ -64,7 +64,7 @@ describe User do
it "users who have signed up, but not confirmed should show up in search index due to VRFS-378" do
@user3 = FactoryGirl.create(:user, first_name: "unconfirmed", last_name: "unconfirmed", email: "unconfirmed@example.com",
password: "foobar", password_confirmation: "foobar", musician: true, email_confirmed: false,
city: "Apex", state: "NC", country: "USA")
city: "Apex", state: "NC", country: "US")
ws = User.search("unconfirmed")
ws.length.should == 1
@ -77,4 +77,4 @@ describe User do
user_result = ws[0]
user_result.id.should == @user3.id
end
end
end

View File

@ -6,7 +6,7 @@ describe User do
before do
@user = User.new(first_name: "Example", last_name: "User", email: "user@example.com",
password: "foobar", password_confirmation: "foobar", city: "Apex", state: "NC", country: "USA", terms_of_service: true, musician: true)
password: "foobar", password_confirmation: "foobar", city: "Apex", state: "NC", country: "US", terms_of_service: true, musician: true)
@user.musician_instruments << FactoryGirl.build(:musician_instrument, user: @user)
end
@ -285,7 +285,7 @@ describe User do
end
describe "create_dev_user" do
before { @dev_user = User.create_dev_user("Seth", "Call", "seth@jamkazam.com", "Jam123", "Austin", "Texas", "USA", nil, nil) }
before { @dev_user = User.create_dev_user("Seth", "Call", "seth@jamkazam.com", "Jam123", "Austin", "Texas", "US", nil, nil) }
subject { @dev_user }
@ -298,7 +298,7 @@ describe User do
end
describe "updates record" do
before { @dev_user = User.create_dev_user("Seth", "Call2", "seth@jamkazam.com", "Jam123", "Austin", "Texas", "USA", nil, nil) }
before { @dev_user = User.create_dev_user("Seth", "Call2", "seth@jamkazam.com", "Jam123", "Austin", "Texas", "US", nil, nil) }
it { should be_valid }

View File

@ -9,7 +9,7 @@ FactoryGirl.define do
musician true
city "Apex"
state "NC"
country "USA"
country "US"
terms_of_service true