Skip to content

Commit d4eb7a6

Browse files
committed
More tests!
1 parent f30395d commit d4eb7a6

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

test/spec/resources/django_spec.rb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,42 @@
136136
end # /context with a secret key
137137
end # /describe #local_settings
138138

139+
describe '#default_local_settings_path' do
140+
subject { chef_run.application_django('/test').send(:default_local_settings_path) }
141+
142+
context 'with no settings.py' do
143+
recipe(subject: false) do
144+
application_django '/test' do
145+
def settings_module
146+
nil
147+
end
148+
end
149+
end
150+
it { is_expected.to be_nil }
151+
end # /context with no settings.py
152+
153+
context 'with basic settings.py' do
154+
recipe(subject: false) do
155+
application_django '/test' do
156+
settings_module 'myapp.settings'
157+
end
158+
end
159+
it { is_expected.to eq '/test/myapp/local_settings.py' }
160+
end # /context with basic settings.py
161+
end # /describe #default_local_settings_path
162+
163+
describe '#default_manage_path' do
164+
subject { chef_run.application_django('/test').send(:default_manage_path) }
165+
recipe(subject: false) do
166+
application_django '/test'
167+
end
168+
before do
169+
allow(chef_run.application_django('/test')).to receive(:find_file).with('manage.py').and_return('/test/manage.py')
170+
end
171+
172+
it { is_expected.to eq '/test/manage.py' }
173+
end # /describe #default_manage_path
174+
139175
describe '#find_file' do
140176
let(:files) { [] }
141177
recipe(subject: false) do

0 commit comments

Comments
 (0)