Skip to content

Instantly share code, notes, and snippets.

@alexshapalov
Created September 2, 2015 12:39
Show Gist options
  • Save alexshapalov/15ebe1931d88081d576b to your computer and use it in GitHub Desktop.
Save alexshapalov/15ebe1931d88081d576b to your computer and use it in GitHub Desktop.
RSpec.describe 'Authenticated admin can write meta tags', type: :feature, js: true do
let!(:user) { create :user, :admin, email: 'admin@new.com' }
let!(:city) { create :city, name: 'loddgy' }
let!(:property) { create :property }
describe 'Authenticated adnin' do
specify 'Admin Can create new post' do
visit '/home'
find('.top-bar-section').click_on 'Sign In'
find('.signin').fill_in 'Email', with: 'admin@new.com'
find('.passin').fill_in 'Password', with: '12345678'
find('.button.expand.tiny.login').click
expect(current_path).to eq '/home'
visit '/admin/cities/loddgy/properties/new'
fill_in 'Address *', with: 'Test address'
select 'Hostel'
fill_in 'Price *', with: property.price
select 'Flexible'
fill_in 'Contact Name *', with: property.contact_name
fill_in 'Email Manager *', with: property.email
fill_in 'Phone Number *', with: property.phone
fill_in 'Title', with: 'Test title'
fill_in 'Description', with: 'Test description'
fill_in 'Keywords', with: 'Test keywords'
click_on 'Continue'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment