Fix false positive test in cms acceptance

This test was passing in Jenkins, but failing in our Solano runs (and locally on firefox).
This is because it was attaching a file that was not there. This change fixes the test
and makes the attachment method smarter so it will fail if it tries attaching a non-existent
file.
This commit is contained in:
Ben Patterson
2014-07-29 08:05:35 -04:00
parent 2848f7ab58
commit 9b22ceb9f8
2 changed files with 2 additions and 1 deletions

View File

@@ -345,6 +345,7 @@ def get_codemirror_value(index=0, find_prefix="$"):
def attach_file(filename, sub_path):
path = os.path.join(TEST_ROOT, sub_path, filename)
world.browser.execute_script("$('input.file-input').css('display', 'block')")
assert_true(os.path.exists(path))
world.browser.attach_file('file', os.path.abspath(path))

View File

@@ -141,7 +141,7 @@ def click_upload_button(_step):
@step('I upload a new course image$')
def upload_new_course_image(_step):
upload_file('image.jpg')
upload_file('image.jpg', sub_path="uploads")
@step('I should see the new course image$')