diff --git a/spec/controllers/admin/versions_controller_spec.rb b/spec/requests/admin/versions_controller_spec.rb similarity index 73% rename from spec/controllers/admin/versions_controller_spec.rb rename to spec/requests/admin/versions_controller_spec.rb index 0d0811d70c1..f8ef30aa506 100644 --- a/spec/controllers/admin/versions_controller_spec.rb +++ b/spec/requests/admin/versions_controller_spec.rb @@ -15,21 +15,23 @@ describe Admin::VersionsController do end context 'while logged in as an admin' do + let(:admin) { Fabricate(:admin) } before do - @user = log_in(:admin) + sign_in(admin) end describe 'show' do - subject { get :show, format: :json } - it { is_expected.to be_successful } - it 'should return the currently available version' do - json = JSON.parse(subject.body) + get "/admin/version_check.json" + expect(response.status).to eq(200) + json = JSON.parse(response.body) expect(json['latest_version']).to eq('1.2.33') end it "should return the installed version" do - json = JSON.parse(subject.body) + get "/admin/version_check.json" + json = JSON.parse(response.body) + expect(response.status).to eq(200) expect(json['installed_version']).to eq(Discourse::VERSION::STRING) end end