spec/unit/configuration/account_spec.rb in imap-backup-1.0.11 vs spec/unit/configuration/account_spec.rb in imap-backup-1.0.12
- old
+ new
@@ -40,12 +40,12 @@
end
context '#run' do
let(:highline) { double('Highline') }
let(:menu) { MockHighlineMenu.new }
- let(:store) { double('Imap::Backup::Configuration::Store', :data => data) }
- let(:data) { {:accounts => [account, account1]} }
+ let(:store) { double('Imap::Backup::Configuration::Store', :accounts => accounts) }
+ let(:accounts) { [account, account1] }
let(:account) do
{
:username => existing_email,
:server => existing_server,
:local_path => '/backup/path',
@@ -290,17 +290,17 @@
it 'asks for confirmation' do
expect(highline).to have_received(:agree)
end
it 'deletes the account' do
- expect(data[:accounts].find{|a| a[:username] == existing_email}).to be_nil
+ expect(accounts.find { |a| a[:username] == existing_email }).to be_nil
end
context 'without confirmation' do
let(:confirmed) { false }
it 'does nothing' do
- expect(data[:accounts].find{|a| a[:username] == existing_email}).to eq(account)
+ expect(accounts.find{|a| a[:username] == existing_email}).to eq(account)
end
end
end
end
end