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
# fizzbuzz.rb | |
def fizzbuzz(number) | |
return "FizzBuzz" if number % 3 == 0 && number % 5 == 0 | |
return "Fizz" if number % 3 == 0 | |
return "Buzz" if number % 5 == 0 | |
number | |
end | |
# fizzbuzz_spec.rb | |
require './fizzbuzz' |
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 Foo | |
attr_reader :bar | |
def change_bar | |
bar ? @bar = false : @bar = true | |
end | |
end | |
describe 'Foo' do | |
let(:foo) { Foo.new } |
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 'PUT #update' do | |
let!(:user) { create(:user_complete_profile) } | |
let(:params) { { user: { id: user.id, email: '[email protected]' } } } | |
before do | |
sign_in user | |
session[:return_to] = projects_path | |
end | |
it 'we should be on projects path' do |