This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
module Visits | |
class Create | |
include BaseService | |
def initialize(patient:, visit_params:) | |
@patient = patient | |
@visit_params = visit_params | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require 'rails_helper' | |
describe Visits::Create do | |
subject { described_class.new(params).call } | |
let_it_be(:doctor) { create :user } | |
let_it_be(:patient) { create :user } | |
let_it_be(:slot) { create :slot, user: doctor, date: Time.current } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let_it_be(:variables) { | |
{ | |
content: | |
'data:application/pdf;base64,JVBERi0xLjMKJf////8KOCAwIG9iago8PAovVHlwZSAvRXh0R1N0YXRlCi9jYSAxCj4+CmVuZG9iago2IDAgb2JqCjw8Ci9UeXBlIC9QYWdlCi9QYXJlbnQgMiAwIFIKL01lZGlhQm94IFswIDAgNTk1LjI4IDg0MS44OV0KL0NvbnRlbnRzIDQgMCBSCi9SZXNvdXJjZXMgNSAwIFIKPj4KZW5kb2JqCjUgMCBvYmoKPDwKL1Byb2NTZXQgWy9QREYgL1RleHQgL0ltYWdlQiAvSW1hZ2VDIC9JbWFnZUldCi9YT2JqZWN0IDw8Ci9JMSA3IDAgUgo+PgovRXh0R1N0YXRlIDw8Ci9HczEgOCAwIFIKPj4KL0ZvbnQgPDwKL0YyIDkgMCBSCi9GNCAxMCAwIFIKL0YxMiAxMSAwIFIKPj4KPj4KZW5kb2JqCjE0IDAgb2JqCjw8Ci9UeXBlIC9QYWdlCi9QYXJlbnQgMiAwIFIKL01lZGlhQm94IFswIDAgNTk1LjI4IDg0MS44OV0KL0NvbnRlbnRzIDEyIDAgUgovUmVzb3VyY2VzIDEzIDAgUgo+PgplbmRvYmoKMTMgMCBvYmoKPDwKL1Byb2NTZXQgWy9QREYgL1RleHQgL0ltYWdlQiAvSW1hZ2VDIC9JbWFnZUldCi9FeHRHU3RhdGUgPDwKL0dzMSA4IDAgUgo+PgovRm9udCA8PAovRjQgMTAgMCBSCi9GMTIgMTEgMCBSCj4+Cj4+CmVuZG9iagoxNyAwIG9iago8PAovVHlwZSAvUGFnZQovUGFyZW50IDIgMCBSCi9NZWRpYUJveCBbMCAwIDU5NS4yOCA4NDEuODldCi9Db250ZW50cyAxNSAwIFIKL1Jlc291cmNlcyAxNiAwIFIKPj4KZW5kb2JqCjE2IDAgb2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Kijek | |
def roll_a_die | |
rand(100) | |
end | |
def win | |
puts 'Kijek: Jedź bezpieczeni Sarin!' | |
end | |
def loose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe Admin::Merchant::Create do | |
subject(:result) { described_class.call(params) } | |
context "valid data" do | |
let(:params) { | |
{ | |
name: "Death Star supplier", | |
category: "Space Merchants" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe Admin::Merchant::Create do | |
subject(:result) { described_class.call(params) } | |
context "valid data" do | |
let(:params) { | |
{ | |
name: "Death Star supplier", | |
category: "Space Merchants" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyRequests.prototype.display_response = function(response){}; | |
MyRequests.prototype.get_topics = function(bstokJS_stage) { | |
$.ajax({ | |
type: 'GET', | |
url: 'https://gist.githubusercontent.com/panSarin/3d0e3080ee36e3b82c79/raw/8f496cfd22a766644b0ee834afb813ca1790c304/bstokjs'+bstokJS_stage+'.json', | |
contentType: "application/json; charset=utf-8", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{'XX' : 'YYY', 'ZZ': 'AAA'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ 'KR' : 'Angular and stuff', 'AP' : 'Jasmine', 'AC' : 'AexolGl'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationPolicy | |
# ... content generated by pundit (its about access for actions - we will discuss it in part 2 of that blogpost) | |
class Scope # our default scope for each model | |
attr_reader :user, :scope | |
def initialize(user, scope) | |
@user = user | |
@scope = scope | |
end |
NewerOlder