'Scenario: Can publish a unit and see published content in LMS
Given I have a section with 2 subsections and 3 unpublished units
When I go to the course outline
Then I see publish button for the first unit, subsection, section
When I publish the first unit
Then I see that publish button for the first unit disappears
And I see publish buttons for subsection, section
And I see the changed content in LMS'

def test_unit_publishing(self):

    self._add_unpublished_content()
    self.course_outline_page.visit()
    (section, subsection, unit) = self._get_items()
    self.assertTrue(unit.publish_action)
    self.assertTrue(subsection.publish_action)
    self.assertTrue(section.publish_action)
    unit.publish()
    self.assertFalse(unit.publish_action)
    self.assertTrue(subsection.publish_action)
    self.assertTrue(section.publish_action)
    self.courseware.visit()
    self.assertEqual(1, self.courseware.num_xblock_components)
