/*   ./spec/bmi_ui_spec.js
*/
describe('BMI_UI - index.html', function() {
    beforeEach(function() {
        jasmine.getFixtures().fixturesPath = '.';
        loadFixtures('index.html');
        $.holdReady(false);
        $('#weight').val(85);
        $('#height').val('185');
        $("input[type='radio']").get(0).checked = true;
        $('#calculate').trigger('click');
    });

    it("displays metric BMI Value", function() {
        expect($('#display_value').text()).toBe('Your BMI is 24.84');
    });

    it("displays metric BMI Message", function() {
        expect($('#display_message').text()).toBe('and you are Normal');
    });



    it("displays imperial BMI Value", function() {
        $('#weight').val('187');
        $('#height').val('72');
        $("input[type='radio']").get(1).checked = true;
        $('#calculate').trigger('click');
        expect($('#display_value').text()).toBe('Your BMI is 25.36');
    });

    it("displays imperial BMI Message", function() {
        $('#weight').val('187');
        $('#height').val('72');
        $('#toggle').val('true');
        expect($('#display_message').text()).toBe('and you are Overweight');
    });
});

@@ -224,26 +224,52 @@
   $(
-'#weight').val(85)
+%22input%5Btype='radio'%5D%22).get(0).checked = true
 ;%0A  
@@ -270,33 +270,33 @@
 ue;%0A        $('#
-h
+w
 eight').val('185
@@ -295,13 +295,10 @@
 val(
-'1
 85
-'
 );%0A 
@@ -310,52 +310,27 @@
   $(
-%22input%5Btype='radio'%5D%22).get(0).checked = true
+'#height').val(185)
 ;%0A  
@@ -702,37 +702,60 @@
       $(
-'#weight').val('187')
+%22input%5Btype='radio'%5D%22).get(1).checked = true
 ;%0A      
@@ -752,33 +752,33 @@
 ue;%0A        $('#
-h
+w
 eight').val('72'
@@ -765,36 +765,35 @@
 ('#weight').val(
-'72'
+187
 );%0A        $(%22in
@@ -793,52 +793,26 @@
   $(
-%22input%5Btype='radio'%5D%22).get(1).checked = true
+'#height').val(72)
 ;%0A  

add the class toggle check for jquery to each toggle case, radio button array-index 0 for metric, array-index 1 for imperial