china_city_spec.rb 793 B

1234567891011121314151617181920212223242526272829303132333435
  1. require 'spec_helper'
  2. feature 'china city', js: true do
  3. scenario 'select' do
  4. visit '/china_city'
  5. within '.rails-helper' do
  6. select '广东省'
  7. select '深圳市'
  8. select '南山区'
  9. end
  10. within '.html-tag' do
  11. select '广东省'
  12. select '深圳市'
  13. select '南山区'
  14. end
  15. end
  16. scenario 'clean' do
  17. visit '/china_city'
  18. within '.rails-helper' do
  19. select '广东省'
  20. select '深圳市'
  21. select '南山区'
  22. select '--城市--'
  23. # save_and_open_page
  24. expect(find('.city-district').value).to be_blank
  25. select '深圳市'
  26. select '南山区'
  27. select '--省份--'
  28. expect(find('.city-city').value).to be_blank
  29. expect(find('.city-district').value).to be_blank
  30. end
  31. end
  32. end