diff options
| author | mo khan <mo@mokhan.ca> | 2014-07-05 15:00:36 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-07-05 15:00:36 -0600 |
| commit | 87635b144c862c91a2c85ff8d693d3fb6079ad8c (patch) | |
| tree | 3bb83f525cb81219cbd6c26b5a2924762b93f10a /spec/features | |
| parent | 83e80f6536025bcf08c3613874ec51fb0e868eff (diff) | |
fix broken feature spec and add helper to wait for ajax requests to complete.
Diffstat (limited to 'spec/features')
| -rw-r--r-- | spec/features/upload_creation_spec.rb | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/spec/features/upload_creation_spec.rb b/spec/features/upload_creation_spec.rb index 62e70ccc..dd366d58 100644 --- a/spec/features/upload_creation_spec.rb +++ b/spec/features/upload_creation_spec.rb @@ -1,30 +1,31 @@ require "rails_helper" describe "uploading a new creation", :js => true do - let!(:user) { create(:user, :password => "password") } + let!(:user) { create(:user, password: "password") } let!(:category_1) { create(:category) } let!(:category_2) { create(:category) } before :each do visit user_session_path within('.form-inline') do - fill_in('user_email', :with => user.email) - fill_in('user_password', :with => "password") + fill_in('user_email', with: user.email) + fill_in('user_password', with: "password") end click_button("Sign In") + click_link("avatar-link") click_link("Add Creation") - + wait_for_ajax within(".form-horizontal") do - fill_in("creation_name", :with => "yummy cake") - fill_in("creation_watermark", :with => "yummy") - fill_in("creation_story", :with => "this was just so damn yummy so i ate it alone.") - select(category_2.name, :from => 'creation_category_id') - #fill_in("creation_tags", :with => "cake, yummy") + fill_in("cake_name", with: "yummy cake") + fill_in("cake_watermark", with: "yummy") + fill_in("cake_story", with: "this was just so damn yummy so i ate it alone.") + select(category_2.name, from: 'cake_category_id') + #fill_in("cake_tags", :with => "cake, yummy") end - click_button("NEXT STEP") + click_button("Create") end it "should get them to the image upload page" do - page.should have_content("Step 2 of 2") + expect(page).to have_text("yummy cake") end end |
