summaryrefslogtreecommitdiff
path: root/spec/features/upload_creation_spec.rb
blob: 00122caa4b2baae60dea146657042cf2f15a5715 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require "rails_helper"

describe "uploading a new creation", :js => true do
  let!(:user) { create(:user, password: "password") }
  let!(:category_1) { create(:category) }
  let!(:category_2) { create(:category) }

  before :each do
    visit login_path
    within('.form-inline') do
      fill_in('session_email', with: user.email)
      fill_in('session_password', with: "password")
    end
    click_button("Sign In")
    click_link("Add Creation")
    wait_for_ajax
    within(".form-horizontal") do
      fill_in("cake_name", with: "yummy cake")
      select(category_2.name, from: 'cake_category_id')
    end
    click_button("Create")
  end

  xit "should get them to the image upload page" do
    expect(page).to have_text("yummy cake")
  end
end