Skip to content

Instantly share code, notes, and snippets.

@jennifer-shehane
Last active October 30, 2015 14:57
Show Gist options
  • Save jennifer-shehane/777850fc5fcc58d0fed8 to your computer and use it in GitHub Desktop.
Save jennifer-shehane/777850fc5fcc58d0fed8 to your computer and use it in GitHub Desktop.
before_each_err
describe "Questions List", ->
beforeEach ->
cy
.server()
context "layout", ->
beforeEach ->
cy
.route(/form_templates\/\d+$/, "fixture:form_template").as("getFormTemplate")
.route(/form_templates\/\d+\/question_headings/, "fixture:question_headings").as("getQuestionHeadings")
.route(/form_templates\/\d+\/questions/, "fixture_questions").as("getQuestions")
.region("#main")
.wait(["@getFormTemplate", "@getQuestionHeadings", "@getQuestions"])
describe "question headings list", ->
beforeEach ->
cy
.get(".question-heading-list")
.find(">li:first .question-heading-wrapper").as("firstQuestionHeading")
context "edit question heading", ->
describe "successfully update [26a]", ->
it "PUTS name [26b]", ->
cy
.route("PUT", /question_headings\/\d+/, @questionHeading).as("putQuestionHeading")
.get("@firstQuestionHeading").within ->
cy
.get("[data-js='edit-question-heading']").click()
.get("input").type("bar").blur()
.wait("@putQuestionHeading").then (request) ->
expect(request.requestJSON).to.have.property "name"
@jennifer-shehane
Copy link
Author

screen shot 2015-10-27 at 3 24 59 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment