* VRFS-1978 - state is now autopopulated again
This commit is contained in:
parent
027456105b
commit
4ecf7abb1e
|
|
@ -86,10 +86,10 @@ CREATE OR REPLACE FUNCTION generate_scores_dataset () RETURNS VOID STRICT VOLATI
|
|||
INSERT INTO cities (city, region, countrycode) select distinct city, region, countrycode from geoiplocations where length(city) > 0 and length(countrycode) > 0;
|
||||
|
||||
DELETE FROM regions;
|
||||
INSERT INTO regions (region, countrycode) select distinct region, countrycode from cities;
|
||||
INSERT INTO regions (region, regionname, countrycode) select distinct region, region, countrycode from cities;
|
||||
|
||||
DELETE FROM countries;
|
||||
INSERT INTO countries (countrycode) select distinct countrycode from regions;
|
||||
INSERT INTO countries (countrycode, countryname) select distinct countrycode, countrycode from regions;
|
||||
|
||||
END IF;
|
||||
RETURN;
|
||||
|
|
|
|||
|
|
@ -463,6 +463,9 @@ JS
|
|||
end
|
||||
|
||||
def load_location(remote_ip, location = nil)
|
||||
# useful if you need to repro something on 127.0.0.1
|
||||
# remote_ip = ' 23.119.29.89'
|
||||
|
||||
@location = location
|
||||
|
||||
if @location.nil?
|
||||
|
|
@ -471,7 +474,6 @@ JS
|
|||
|
||||
@location[:country] = "US" if @location[:country].nil?
|
||||
|
||||
# right now we only accept US signups for beta
|
||||
@countriesx = MaxMindManager.countries
|
||||
# populate regions based on current country
|
||||
@regions = MaxMindManager.regions(@location[:country])
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
<option value="" <%= @location[:state].blank? ? "selected" : "" %>>State/Province</option>
|
||||
<% @regions.each do |region| %>
|
||||
<% unless region.blank? %>
|
||||
<option value="<%= region[:region] %>" <%= @location[:state] == region ? "selected" : "" %>><%= region[:name] %></option>
|
||||
<option value="<%= region[:region] %>" <%= @location[:state] == region[:region] ? "selected" : "" %>><%= region[:name] %></option>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,21 @@ describe "Signup", :js => true, :type => :feature, :capybara_feature => true do
|
|||
before(:each) do
|
||||
@mac_client = FactoryGirl.create(:artifact_update)
|
||||
UserMailer.deliveries.clear
|
||||
MaxMindManager.create_phony_database
|
||||
end
|
||||
|
||||
describe "signup page" do
|
||||
before { visit signup_path }
|
||||
|
||||
it { should have_selector('h2', text: 'Create a JamKazam account') }
|
||||
it "should initialize successfully" do
|
||||
should have_selector('h2', text: 'Create a JamKazam account')
|
||||
|
||||
# we should see these locations in the signup form already chosen
|
||||
location = GeoIpLocations.lookup('127.0.0.1')
|
||||
find('.field.country .easydropdown .selected', text:location[:country])
|
||||
find('.field.state .easydropdown .selected', text:location[:state])
|
||||
find('.field.city .easydropdown .selected', text:location[:city])
|
||||
end
|
||||
|
||||
describe "with valid musician information" do
|
||||
before do
|
||||
|
|
@ -30,7 +39,12 @@ describe "Signup", :js => true, :type => :feature, :capybara_feature => true do
|
|||
it {
|
||||
should have_title("JamKazam | Congratulations")
|
||||
should have_content("You have successfully registered as a JamKazam musician.")
|
||||
User.find_by_email('newuser1@jamkazam.com').musician_instruments.length.should == 1
|
||||
user = User.find_by_email('newuser1@jamkazam.com')
|
||||
user.musician_instruments.length.should == 1
|
||||
location = GeoIpLocations.lookup('127.0.0.1')
|
||||
user.country.should == location[:country]
|
||||
user.state.should == location[:state]
|
||||
user.city.should == location[:city]
|
||||
# an email is sent on no-invite signup
|
||||
UserMailer.deliveries.length.should == 1
|
||||
UserMailer.deliveries[0].html_part.body.include?("To confirm this email address")== 1
|
||||
|
|
|
|||
Loading…
Reference in New Issue