Merge pull request #7482 from open-craft/fix_duplicate_rcb

Fix duplication of Randomized Content Blocks
This commit is contained in:
Kelketek
2015-04-03 12:50:09 -05:00
12 changed files with 232 additions and 50 deletions

View File

@@ -406,6 +406,20 @@ class XBlockWrapper(PageObject):
def has_group_visibility_set(self):
return self.q(css=self._bounded_selector('.wrapper-xblock.has-group-visibility-set')).is_present()
@property
def has_duplicate_button(self):
"""
Returns true if this xblock has a 'duplicate' button
"""
return self.q(css=self._bounded_selector('a.duplicate-button'))
@property
def has_delete_button(self):
"""
Returns true if this xblock has a 'delete' button
"""
return self.q(css=self._bounded_selector('a.delete-button'))
@property
def has_edit_visibility_button(self):
"""

View File

@@ -290,3 +290,21 @@ class StudioLibraryContainerTest(StudioLibraryTest, UniqueCourseTest):
block.reset_field_val("Display Name")
block.save_settings()
self.assertEqual(block.name, name_default)
def test_cannot_manage(self):
"""
Scenario: Given I have a library, a course and library content xblock in a course
When I go to studio unit page for library content block
And when I click the "View" link
Then I can see a preview of the blocks drawn from the library.
And I do not see a duplicate button
And I do not see a delete button
"""
block_wrapper_unit_page = self._get_library_xblock_wrapper(self.unit_page.xblocks[0].children[0])
container_page = block_wrapper_unit_page.go_to_container()
for block in container_page.xblocks:
self.assertFalse(block.has_duplicate_button)
self.assertFalse(block.has_delete_button)
self.assertFalse(block.has_edit_visibility_button)