Skip to content

Instantly share code, notes, and snippets.

@ebbnormal
Created March 15, 2016 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebbnormal/462757c2c085bf749d5c to your computer and use it in GitHub Desktop.
Save ebbnormal/462757c2c085bf749d5c to your computer and use it in GitHub Desktop.
a small feature spec
feature "Create Scores" do
let(:user) {FactoryGirl.create(:user, name: 'Garret Hickman')}
background{ login_as user}
scenario "takes you to the score show path" do
create_score("handwritten", "Feel tempo. Feel tempoless. Fly fly fly fly fly!")
expect(current_path).to eq(score_path)
end
def create_score(type, text)
if(type=="handwritten")
visit scores_path
click_button "Handwrite A Score"
fill_in 'Score', with: text
click_button 'Save'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment