codeforamerica/MuniciPal — pull request #121 by techieshark (2014-11-13 02:27:53+00:00)
Title: fix back navigation

This fixes #67

To test it, look at the test case provided in #67. It should work there. It should also work in the following situations (in the example tests below, `M` is the result of the test on the master branch, and `B' is the result on this branch when I tested it).

Test A
1. Go to homepage.
2. Select any councilmember's district from the top navigation drop down menu.
3. Go back.
We should be on the homepage again.

M: fails
B: pass

Test B
1. Go to homepage.
2. Select district 1.
3. Select district 2.
4. Go back.
We should be on district 1's page.

M: fails
B: pass

Test C
1. Go to homepage.
2. Click example address.
We should see district 3 highlighted and that district's results shown, with the marker near Baseline Rd.
3. Click back.
We should be on the homepage.

M: fails (requires two clicks, as above)
B: pass

Test D
1. Go to homepage.
2. Wait for district boundaries to load.
3. Drag marker to location in another district.
We should see that district highlighted and it's results shown.
4. Drag marker to another district.
We should see the new district highlighted and it's results shown.
5. click back
We should see the first district highlighted and it's results shown.
6. Click back.
We should see the homepage.

M: fails (and if you go back too far, you get some json stuff at http://localhost:3000/?lat=33.38128611549358&lng=-111.80408477783203; as you click back, the page isn't updated but the address bar is, and eventually you are at localhost:3000 and going back one more gives unexpected json output).

B: pass

Test E
1. Go to homepage.
2. Type '455 W Baseline Rd, Mesa AZ' in the address search field and click the button.
We should see district 3 highlighted and that district's results shown, with the marker near Baseline Rd.
3. Enter an address in district 4 (20 E Main St, Mesa AZ)
We should see district 4 highlighted and that district's results shown, with the marker at the address you specified.
5. Drag the marker to district 5.
The marker should stay where you dropped it, in district 5. That district should be highlighted and its results shown.
6. Drag the marker to district 6.
The marker should stay where you dropped it, in district 6. That district should be highlighted and its results shown.
6. Click back.
We should see the results from district 5.
7. Click back.
We should see the results from district 4.
8. Click back.
We should see the results from district 3.
9. Click back.
We should see the home page.

M: fails
B: pass

Test F:
1. Go to codeforamerica.org
2. Go to homepage (type the url in the addressbar).
3. Click back.
We should see codeforamerica.org

M: pass
B: pass

Test G:
1. Go to homepage.
2. Drag the marker to a district on the map (ex: D1)
3. Select a different district from the menu (ex: D2)
4. Click back.
We should be on D1.

M: Broken, you might see a bunch of json.
B: pass