Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
--require spec_helper

--format documentation
--color

--color
--format documentation
Comment thread
Odeane marked this conversation as resolved.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source 'https://rubygems.org'
ruby '2.6.3'
ruby '2.5.1'

Comment thread
Odeane marked this conversation as resolved.
gem 'rails', '5.1.5'

Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ DEPENDENCIES
web-console (~> 2.0)

RUBY VERSION
ruby 2.6.3p62
ruby 2.5.1p57

BUNDLED WITH
2.1.4
1.17.3
44 changes: 0 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,3 @@
## CA Mailboxer 2018

<<<<<<< HEAD
Code base for week 5 challenge - Working with legacy code




User Stories

As a message sender
I want an application that allows me to compose messages,
So that I can send to my friends and family.

As a message sender
I want to have a confirmation prompt after sending a message
So that i know the message was sucessfully sent.


As a user
I want to have an account with a password that I can login into,
So that I can can keep my messages private.


As a message sender
I want to have an inbox
So that I can store my messages


As a user
In order to see my sent message
i



As a message sender
I want to be able to delete messages from my inbox and sent
So that I can remove unwanted messages.



As a message sender
I want to store my recipients
So that I do not need to re-enter their information when I want to message them.
=======
Code base for week 5 challenge - Working with legacy code...
>>>>>>> d3d15580843b410b3595c83957606a1c414e7c9f
10 changes: 5 additions & 5 deletions spec/factories/user.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FactoryBot.define do
factory :user do
email {'user@mail.com'}
password { 'password'}
name { 'Name'}
end
factory :user do
email {'user@mail.com'}
password { 'password'}
name { 'Name'}
end
end
Comment thread
Odeane marked this conversation as resolved.
22 changes: 10 additions & 12 deletions spec/feature/user_can_log_in_feature_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,31 @@
context 'Sign in to account'
before do
create(:user, email: 'user@mail.com', password: '12345678')
visit user_session_path
end
visit user_session_path
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

it 'displays a log in button' do
expect(page).to have_content 'Login'
click_on 'Login'
expect(page).to have_content 'Login'
click_on 'Login'
end

it 'displays a email form' do
expect(page).to have_content 'Email'
expect(page).to have_content 'Email'
end

it 'fills in email and password' do
fill_in "Email", :with => 'user@mail.com'
fill_in "Password", :with => '12345678'
click_on "Log in"
expect(page).to have_content 'Signed in successfully.'
expect(page).to have_content 'Signed in successfully.'
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

it 'If no email or password is entered' do
fill_in 'Email', :with => ''
fill_in 'Password', :with => ''
it 'If the email format is incorrect or the password is too short' do
fill_in 'Email', :with => '&5aygde'
fill_in 'Password', :with => '22'
Comment thread
Odeane marked this conversation as resolved.
Outdated
click_on 'Log in'
expect(page).to have_content 'Invalid Email or password.'
expect(page).to have_content 'Invalid Email or password.'
end
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format the code



end
Comment thread
Odeane marked this conversation as resolved.


Comment thread
Odeane marked this conversation as resolved.
26 changes: 13 additions & 13 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
require 'rails_helper'

RSpec.describe User, type: :model do
describe 'db table' do
it {is_expected.to have_db_column :email}
it {is_expected.to have_db_column :encrypted_password}
it {is_expected.to have_db_column :name}
end
describe 'db table' do
it {is_expected.to have_db_column :email}
it {is_expected.to have_db_column :encrypted_password}
it {is_expected.to have_db_column :name}
end

describe 'validations' do
it {is_expected.to validate_presence_of :email}
it {is_expected.to validate_presence_of :password}
end
describe 'validations' do
it {is_expected.to validate_presence_of :email}
it {is_expected.to validate_presence_of :password}
end

describe 'Factory' do
it 'should have valid factory' do
expect(FactoryBot.create(:user)).to be_valid
end
describe 'Factory' do
it 'should have valid factory' do
expect(FactoryBot.create(:user)).to be_valid
end
end
end
Comment thread
Odeane marked this conversation as resolved.