'Scenario: Ensure that the user can delete unused group configuration.
Given I have a course with 2 group configurations
And I go to the Group Configuration page
When I delete the Group Configuration with name "Configuration 1"
Then I see that there is one Group Configuration
When I edit the Group Configuration with name "Configuration 2"
And I delete the Group Configuration with name "Configuration 2"
Then I see that the are no Group Configurations'

def test_can_delete_unused_group_configuration(self):

    self.course_fixture._update_xblock(self.course_fixture._course_location, {'metadata': {u'user_partitions': [create_user_partition_json(0, 'Configuration    1', 'Description    of    the    group    configuration.', [Group('0', 'Group    0'), Group('1', 'Group    1')]), create_user_partition_json(1, 'Configuration    2', 'Second    group    configuration.', [Group('0', 'Alpha'), Group('1', 'Beta'), Group('2', 'Gamma')])]}})
    self.page.visit()
    self.assertEqual(len(self.page.experiment_group_configurations), 2)
    config = self.page.experiment_group_configurations[1]
    config.delete()
    self.assertEqual(len(self.page.experiment_group_configurations), 1)
    config = self.page.experiment_group_configurations[0]
    config.edit()
    self.assertFalse(config.delete_button_is_disabled)
    config.delete()
    self.assertEqual(len(self.page.experiment_group_configurations), 0)
