Skip to content

Instantly share code, notes, and snippets.

View alexshapalov's full-sized avatar
🎯
Focusing

Alex Shapalov alexshapalov

🎯
Focusing
View GitHub Profile
@alexshapalov
alexshapalov / test.rb
Last active September 13, 2023 17:41
Shared example in Rails with RSpec and Capybara
# Shared stuff for logging in
RSpec.shared_context 'logged in user' do
before do
visit '/login'
fill_in 'username', with: 'test_user'
fill_in 'password', with: 'test_password'
click_button 'Login'
end
end
Test Task: Bookstore Rails Application
Objective:
Develop a Rails web application for a bookstore.
Requirements:
Models:
Create the following models with the specified fields and associations:
@alexshapalov
alexshapalov / .rb
Created July 3, 2024 05:23
General Scraper
class ScraperDSL
attr_accessor :name, :home_url, :jobs_url, :structure
def initialize(name)
@name = name
@structure = ScraperStructure.new
end
def home_url(url)
@home_url = url